MouseMove功能和模块

时间:2016-06-24 12:45:21

标签: module vb6 mousemove

我有一个为学校创建的程序,鼠标移动功能占用了大量空间并使其成为一个混乱的项目。我的问题,有没有办法将函数移动到模块?

这些只是一些MouseMove功能:

Private Sub Frame4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
   StatusBar1.SimpleText = "Ready..."
End Sub

Private Sub Text2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.SimpleText = "First Name of Student"
End Sub

Private Sub Text3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.SimpleText = "Last Name of Student"
End Sub

非常感谢你的帮助。 :)

1 个答案:

答案 0 :(得分:0)

这些是属于表单的预定义事件。您无法将它们从表单移到模块中。

您创建一个具有StatusBarUpdate函数的模块,您每次想要更改状态栏时都会调用该函数...但是......使用一行代码替换一行代码似乎是值得的