E
Eric Sabine
I've simplified the code to the following. I'm just overlooking something
very simple I'm sure.
Dim mic() As MenuItem
mic = New MenuItem(3) {}
mic(0) = New MenuItem("a")
mic(0).Index = 1
mic(1) = New MenuItem("b")
mic(1).Index = 2
mic(2) = New MenuItem("c")
mic(2).Index = 3
mic(1).MenuItems.Add(mic(2))
------ error below ------- here I get an "Object reference not set to an
instance of an object." error
myProgramsContextMenu1.MenuItems.AddRange(mic)
What do you think is the cause of the error?
Eric
very simple I'm sure.
Dim mic() As MenuItem
mic = New MenuItem(3) {}
mic(0) = New MenuItem("a")
mic(0).Index = 1
mic(1) = New MenuItem("b")
mic(1).Index = 2
mic(2) = New MenuItem("c")
mic(2).Index = 3
mic(1).MenuItems.Add(mic(2))
------ error below ------- here I get an "Object reference not set to an
instance of an object." error
myProgramsContextMenu1.MenuItems.AddRange(mic)
What do you think is the cause of the error?
Eric