Private Sub Form2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Button = 3 Then
MsgBox("Error encountered while trying to open file," & vbCrLf & "please retry.", vbExclamation, "Text Editor")
End If
End Sub
只有父窗体时无效,创建子窗体也无效。
请老师指点。
------解决方案--------------------
在form1里调用form2后:
Dim ff As New Form2()
ff.Show()
在form2里
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
tools()
End Sub
Private Sub Form2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
If e.Clicks Then
MsgBox("Error encountered while trying to open file," & vbCrLf & "please retry.", vbExclamation, "Text Editor")
End If
End Sub
Private Sub tools()
End Sub