vb显示鼠标位置

vb显示鼠标位置,第1张

概述Private Sub Form1_MouseMove(ByValeventSender As System.Object, ByVal eventArgs AsSystem.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove          Dim Button As Short = eventArgs.Button\ &H100000

Private Sub Form1_MouseMove(ByValeventSender As System.Object,ByVal eventArgs AsSystem.windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
Dim button As Short = eventArgs.button\ &H100000
Dim Shift As Short =System.windows.Forms.Control.ModifIErKeys \ &H10000
Dim X As Single = eventArgs.X
Dim Y As Single = eventArgs.Y
'当鼠标移动时,相应的状态栏也应该改变
'判断工具栏的按钮是否按下,如果是,则显示鼠标位置
If Toolbar1.buttons(1).Value =MSComctllib.ValueConstants.tbrpressed Then
Statusbar1.Panels(1).Text ="当前鼠标位置:" & X & ","& Y
'否则,显示空
Else
Statusbar1.Panels(1).Text =""
End If
End Sub
Private Sub Toolbar1_buttonClick(ByValeventSender As System.Object,ByVal eventArgs AsAxmsComctllib.IToolbarEvents_buttonClickEvent) Handles Toolbar1.buttonClick
'当单击工具栏时,立刻改变状态栏的信息;要不会出现单击按钮后不发生任何改变
Select Case eventArgs.button.Key
Case "ShowMousePos"
If Toolbar1.buttons(1).Value =MSComctllib.ValueConstants.tbrpressed Then
Statusbar1.Panels(1).Text= "当前鼠标位置:0,0"
Else
Statusbar1.Panels(1).Text= ""
End If
Case Else
End Select
End Sub


来自 http://www.57itsq.com/read.php?tid-1656.html

总结

以上是内存溢出为你收集整理的vb显示鼠标位置全部内容,希望文章能够帮你解决vb显示鼠标位置所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1281513.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存