VB开发触摸屏程序,如何实现按钮的浮动
如何实现,点击一个按钮,然后按钮凹下去,手移开按钮再弹起来?(注:触摸屏只有Click事件,Mousedown,Mouseup都不能实现这个功能)
[解决办法]
应该可以的呀,要不你新建一个工程,在窗口中粘贴以下代码,看看能不能看到三个信,如果能,表示这些事件已经触发,效果看不出来是你的程序效率或设计问题,代码如下:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Line (0, 0)-(Me.Width, Me.FontSize * 15), &H8000000F, BF Me.CurrentX = 0 Me.CurrentY = 0 Print "MouseDown Button:" & Button & " X:" & X & " Y:" & YEnd SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Line (0, Me.FontSize * 15 + 15)-(Me.Width, (Me.FontSize * 15) * 2), &H8000000F, BF Me.CurrentX = 0 Me.CurrentY = Me.FontSize * 15 Print "MouseMove Button:" & Button & " X:" & X & " Y:" & YEnd SubPrivate Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) Line (0, (Me.FontSize * 15) * 2 + 15)-(Me.Width, (Me.FontSize * 15) * 3), &H8000000F, BF Me.CurrentX = 0 Me.CurrentY = (Me.FontSize * 15) * 2 Print "MouseUp Button:" & Button & " X:" & X & " Y:" & YEnd Sub
[解决办法]