Hi I have tried your code but It does not seems to even pickup pressing
of F8 key as an event... I mean if I put the code under Form_KeyDown
Replace what is after Then statement with msgbox("F8") run it and then
press F8 nothing happens...
and the next thing my menus are build from the code like this :
'# creating variables to hold default menu items
Dim TestsItem As New MenuItem
Dim AddTestItem As New MenuItem
Dim DeleteTestItem As New MenuItem
Dim MicrobiologyItem As New MenuItem
Dim ChemistryItem As New MenuItem
Dim GroupTestsItem As New MenuItem
'# assigning them text
TestsItem.Text = "&Tests"
AddTestItem.Text = "&Add Test"
DeleteTestItem.Text = "&Delete Test"
MicrobiologyItem.Text = "&Microbiology"
MicrobiologyItem.Shortcut = Shortcut.CtrlA
MicrobiologyItem.ShowShortcut = True
ChemistryItem.Text = "&Chemistry"
ChemistryItem.Shortcut = Shortcut.F9
ChemistryItem.ShowShortcut = True
GroupTestsItem.Text = "&Group Tests"
GroupTestsItem.Shortcut = Shortcut.F11
GroupTestsItem.ShowShortcut = True
'# adding them to the menu
thisMenu.MenuItems.Add(TestsItem)
TestsItem.MenuItems.Add(AddTestItem)
TestsItem.MenuItems.Add(DeleteTestItem)
AddTestItem.MenuItems.Add(MicrobiologyItem)
AddTestItem.MenuItems.Add(ChemistryItem)
AddTestItem.MenuItems.Add(GroupTestsItem)
there is more code that populates
MicrobiologyItem
ChemistryItem
GroupTestsItem
with loads of another stuff from Database (about another 50
items) none of them has any more subitems
What will the code look like to clone every item from MicrobiologyItem
??
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!