I am working on C# WFA. I have one menustrip which has one item called: Settings, under this I have three items: ID, Number, and Time. Under Number item there has 5 items again which man can choose. Now I want to make it like this: first make one of the items under Number is default chosen, Secondly, I want to have one more textbox in the GUI, which will show which item is selected under number.
For example:
Settings
---ID
---Number
----NUMBER1
----Number 2
----Number 3
---Time
So I want to set the Number 2 as the default chosen item, how can I do that? I want to display the selected Number item in textbox when one is selected, How can I do that?
Thanks a lot!
BR Emma
For Select NUMBER 2 as BY Default you have to add single line in your code,
this.NUMBER2ToolStripMenuItem.Select();
This code for getting text of selected items...
' your method would look something like this
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim mnuItem As MenuItem = DirectCast(sender, MenuItem)
MessageBox.Show(mnuItem.Text)
End Sub '
' and just so you know, it would be attached to the event like so
AddHandler MenuItem2.Click, AddressOf MenuItem2_Click
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.