Hello
i want to write the code for toolbar mousemove. means when i mousemove on buttons it has to popup the message button caption. how can i
Printable View
Hello
i want to write the code for toolbar mousemove. means when i mousemove on buttons it has to popup the message button caption. how can i
try this one........ click ur command button and select the mousemove property
VB Code:
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) MsgBox "Welcome to POP-UP!!!" End Sub
I think they're asking about the Toolbar control, and detecting which button on the toolbar control the mouse is over, then displaying that buttons caption...
I don't know exactly how to do this, but if you know the size of the buttons, you get the X and Y coordinates of the mouse in the MouseMove event and you could calculate which button the mouse was over. Then just reset the Tooltip text, likeNot sure this is what you want, but it's an idea.VB Code:
Toolbar1.ToolTipText = SomeTextHere
I am guessing that you have buttons w/out text, just a picture, and you want to display the button caption in the Tooltip text when the user puts the mouse over the button.
If that is true, this should work for you. I stored each button's tooltip text in the Key property of the button, and it gets displayed when the mouse goes over the button:VB Code:
Private Sub Toolbar1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) Dim ButtonMouseIsOver As Integer With Toolbar1 ' Make sure the mouse is over one of the buttons If x < .Buttons.Count * .ButtonWidth Then ' Determine which button the mouse is over ButtonMouseIsOver = Int(x / .ButtonWidth) + 1 ' Set the tooltip text to the Key of that button .ToolTipText = .Buttons(ButtonMouseIsOver).Key Else ' The mouse isn't over a button, so clear the text .ToolTipText = "" End If End With End Sub