vb鼠标移动时按钮的问题
就是界面上有两个按钮command1和command2,当用户想点command2时,鼠标移过去,command2就会移走,所以只能点command1,我要代码,急!!最...
就是界面上有两个按钮command1和command2,当用户想点command2时,鼠标移过去,command2就会移走,所以只能点command1,我要代码,急!!最好不要太烦
展开
展开全部
当在Command2按下鼠标时,Command2移走,但不触发单击事件. 鼠标移到按钮就移走,不容易办到. Private Sub Command2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Command2.Left = Form1.Width * Rnd / 2 Command2.Top = Form1.Height * Rnd / 2 End Sub
展开全部
Private Sub Command2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim A As Integer, B As Integer, C As Single A = Rnd() * 200 B = Rnd() * 200 C = 0.5 - Rnd Me.Caption = C With Command2 .Left = .Left + (A + .Width) * C .Top = .Top + B * C End With End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询