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 MicrobiologyIte m As New MenuItem
Dim ChemistryItem As New MenuItem
Dim GroupTestsItem As New MenuItem
'# assigning them text
TestsItem.Text = "&Tests"
AddTestItem.Tex t = "&Add Test"
DeleteTestItem. Text = "&Delete Test"
MicrobiologyIte m.Text = "&Microbiol ogy"
MicrobiologyIte m.Shortcut = Shortcut.CtrlA
MicrobiologyIte m.ShowShortcut = True
ChemistryItem.T ext = "&Chemistry "
ChemistryItem.S hortcut = Shortcut.F9
ChemistryItem.S howShortcut = True
GroupTestsItem. Text = "&Group Tests"
GroupTestsItem. Shortcut = Shortcut.F11
GroupTestsItem. ShowShortcut = True
'# adding them to the menu
thisMenu.MenuIt ems.Add(TestsIt em)
TestsItem.MenuI tems.Add(AddTes tItem)
TestsItem.MenuI tems.Add(Delete TestItem)
AddTestItem.Men uItems.Add(Micr obiologyItem)
AddTestItem.Men uItems.Add(Chem istryItem)
AddTestItem.Men uItems.Add(Grou pTestsItem)
there is more code that populates
MicrobiologyIte m
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 MicrobiologyIte m
??
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!