Tell me and I forget. Show me and I remember. Involve me and I understand.
- Anonymous Chinese Proverb
-----------------------------------
If you can't explain it simply, you don't understand it well enough.
- A. Einstein
HI ASMA
yes dotnotdoc is right you can do easily whatever you want in Textbox1_MouseDown or Textbox1_MouseUp event but you might want something different..so here is the logic for you case
Regards
Nouman
Dim myTextbox as TextBox
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
'which text box
If Not myTextbox Is Nothing Then
Select Case myTextbox.Name
Case Is = "TextBox1"
MsgBox("Textbox1 is clicked"
Case Is = "TextBox2"
MsgBox("Textbox2 is clicked"
End Select
End If
End Sub
Private Sub TextBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseDown
If e.Button.Equals(MouseButtons.Right) Then
myTextbox = sender
End If
End Sub
Private Sub TextBox2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox2.MouseDown
If e.Button.Equals(MouseButtons.Right) Then
myTextbox = sender
End If
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.