简体   繁体   中英

how do I add a comment when hovering over a form button?

I'm trying to add a comment that appears when the mouse hovers over a form button, but disappears once you stop pointing to the button. How do I accomplish this?

I tried adding the comment in the other tab in the property sheet menu, but it does not accomplish what I wish to do. Any DETAILED instructions explaining how to do this would be great.

You can accomplish this using the MouseMove Events for your button and the surrounding form section (which is likely to be Form Detail).

In the below example, the visibility of the label is toggled when the mouse is moved between the button and form detail section:

在此处输入图片说明

The above is driven by the following two event handlers:

Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If MyComment.Visible Then MyComment.Visible = False
End Sub
Private Sub MyButton_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Not MyComment.Visible Then MyComment.Visible = True
End Sub

Here, the button is named MyButton and the label containing the comment is named MyComment .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM