|
楼主 |
发表于 2012-1-19 14:39
|
显示全部楼层
sqhsqhli 发表于 2012-1-19 14:21
补充vba示例
建立一窗体,放一按钮,一标签控件。加入以下代码试试:
光标移动到按扭2不会显示,单击才能显示,请教如何修改?
Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Label1.Visible = True
Label1.Caption = "我是按钮1"
Label1.Left = CommandButton1.Left + CommandButton1.Width
Label1.Top = CommandButton1.Top - CommandButton1.Height
End Sub
Private Sub CommandButton2_Click()
Label1.Visible = True
Label1.Caption = "我是按钮2"
Label1.Left = CommandButton2.Left + CommandButton2.Width
Label1.Top = CommandButton2.Top - CommandButton2.Height
End Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Label1.Visible = False
End Sub
Private Sub UserForm_Initialize()
Label1.Visible = False
End Sub
|
|