永发信息网

如何实现vb中实现...鼠标一移动到按钮,按钮名称就会变。

答案:2  悬赏:70  手机版
解决时间 2021-03-20 07:26
  • 提问者网友:雪舞兮
  • 2021-03-19 08:17
比如说,窗体上有个问题,你喜欢我不?有两个按钮,一个是yes,一个是no,当鼠标移动到no时,no就变成yes,可以吗?
最佳答案
  • 五星知识达人网友:平生事
  • 2021-03-19 09:26
Private Sub Command2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command2.Caption = "yes"
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command2.Caption = "no"
End Sub
全部回答
  • 1楼网友:空山清雨
  • 2021-03-19 10:18
只能用窗体的鼠标移动事件了! 画出一个按钮,command1 private sub form_mousemove(button as integer, shift as integer, x as single, y as single) if x > command1.left and x < command1.left + command1.width and y > command1.top and y < command1.top + command1.height then command1.visible = true else: command1.visible = false end if end sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯