toolstrip - mouse event for disabled items?


P

Patrick F

I have been using VB9 express and have not been pleased with the behavior of
the tooltips for toolstrip items. the tooltip sometimes gets 'stuck' onto
the screen over other controls, painted over the top of them until a repaint
event of that control can clear it off.
rather than find a way to not have this happen, I chose to make my own
'tooltip' of sorts using a separate toolstrip and a label that appears at
the bottom of the form on the mouseover event for all my toolstripitems. it
works snazzy and looks good except for the toolstripitems that are disabled.
I can't seem to access any mouse events for them. I have searched my brains
out trying to find a way around this, and the 'GetItemAt' looked promising,
but doesn't seem to work :(

all I want is the to get the tooltiptext of any toolstripitem under the
mouse pointer, even if it is a disabled item.

here is the code I have, using the 'GetItemAt' method:

Private Sub ts1_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles ts1.MouseMove
Dim item As ToolStripItem = CType(ts1.GetItemAt(e.Location),
ToolStripItem)
If item IsNot Nothing Then
lblToolTip.Text = item.ToolTipText
End If
End Sub

can someone please help me.
thank-you,
Patrick
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top