Discussion:
Can you set the time interval before ControlTipText is displayed?
(too old to reply)
Chrisso
2007-12-22 12:53:15 UTC
Permalink
Hi there,

I am implementing the "hack" of placing the selected value of a list
box into its ControlTipText in order for long values to be displayed
when necessary as my list box cannot get any bigger:

Private Sub lbxDisplay_DblClick(Cancel As Integer)
Fill_Display_ControlTipText
End Sub

Private Sub Fill_Display_ControlTipText()
Dim ctlDisplay As Control, var As Variant
Set ctlDisplay = Me.lbxDisplay
Debug.Print ctlDisplay.ItemsSelected.Count
For Each var In ctlDisplay.ItemsSelected
Debug.Print ctlDisplay.ItemData(var)
Me.lbxDisplay.ControlTipText = ctlDisplay.ItemData(var)
Next
End Sub

This works OK and does the job but I would like to change the default
time interval before the ControlTipText is displayed - does anyone
know if this is possible? I cant see any info on it anywhere.

My other problem is that the code above works fine on the DblClick
event but I really need it to work on the Click event but during the
Click event it seems ctlDisplay.ItemsSelected is always 0? This seems
weird to me -any ideas how I can get to the selected items at other
events as the same problem happens with AfterUpdate and MouseUp too?

Thanks in advance for any advice,
Chrisso
Minton M
2007-12-27 22:42:38 UTC
Permalink
Post by Chrisso
Hi there,
I am implementing the "hack" of placing the selected value of a list
box into its ControlTipText in order for long values to be displayed
Private Sub lbxDisplay_DblClick(Cancel As Integer)
Fill_Display_ControlTipText
End Sub
Private Sub Fill_Display_ControlTipText()
Dim ctlDisplay As Control, var As Variant
Set ctlDisplay = Me.lbxDisplay
Debug.Print ctlDisplay.ItemsSelected.Count
For Each var In ctlDisplay.ItemsSelected
Debug.Print ctlDisplay.ItemData(var)
Me.lbxDisplay.ControlTipText = ctlDisplay.ItemData(var)
Next
End Sub
This works OK and does the job but I would like to change the default
time interval before the ControlTipText is displayed - does anyone
know if this is possible? I cant see any info on it anywhere.
My other problem is that the code above works fine on the DblClick
event but I really need it to work on the Click event but during the
Click event it seems ctlDisplay.ItemsSelected is always 0? This seems
weird to me -any ideas how I can get to the selected items at other
events as the same problem happens with AfterUpdate and MouseUp too?
Thanks in advance for any advice,
Chrisso
I researched this to death and I think the answer is no. It *may* be
possible in the deep, dark recesses of API land but I suspect this is
a highly suspect thing to do, and maybe a slight redesign of your GUI
would be easier.

Loading...