I
I_AM_DON_AND_YOU?
I have a Menu with 5 Menus as:
Menu Name Menu Text
M1 File
M2 Edit
M3 View
M4 Insert
I want to execute the code depending upon which menu is clicked. Since most
of the code is same therefore, I want to write the one procedure. Therefore
I tried to write something like...
Private Sub Menu_Click (ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles _
M1.Click, M2.Click, M3.Click, M4.Click
******************
*****************
*************
x = sender.text
msgbox (x)
********
End Sub
When I click the message box shows the Text property of menu i.e. if I click
M1 it shows "File", if I click M2 it shows "Edit" etc. However, I want to
show Name i.e. when I click M1 it should show M1, when I click M2 it should
show M2, and so on.
The second thing I want to ask is that why is that when we type SENDER and
the type dot (.) it doesn't show properties or methods associated with the
sender. However, still we can type TEXT. How would we know what other
methods or properties are associated with SENDER OBJECT.
Thanks in advance!
Menu Name Menu Text
M1 File
M2 Edit
M3 View
M4 Insert
I want to execute the code depending upon which menu is clicked. Since most
of the code is same therefore, I want to write the one procedure. Therefore
I tried to write something like...
Private Sub Menu_Click (ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles _
M1.Click, M2.Click, M3.Click, M4.Click
******************
*****************
*************
x = sender.text
msgbox (x)
********
End Sub
When I click the message box shows the Text property of menu i.e. if I click
M1 it shows "File", if I click M2 it shows "Edit" etc. However, I want to
show Name i.e. when I click M1 it should show M1, when I click M2 it should
show M2, and so on.
The second thing I want to ask is that why is that when we type SENDER and
the type dot (.) it doesn't show properties or methods associated with the
sender. However, still we can type TEXT. How would we know what other
methods or properties are associated with SENDER OBJECT.
Thanks in advance!