PDA

Click to See Complete Forum and Search --> : Menu Control Array


Sujatha
Jan 2nd, 2000, 04:47 PM
I am using VB6.0 (SP3).Can any one tell whether I have to give same Name to the Control Array Elements in a Menu Control Array? Is it wrong if I give different Names to the Array Elements?

Crazy D
Jan 2nd, 2000, 04:54 PM
An array is in general "something" you refer to with the same name, only an index number that is diffent.
eg.
Dim myarray() As String
myarray(1) = "..."
myarray(2) = "......"

Text1(1).Text = "1"
Text1(2).Text = "2"

So, to create an array of menuitems, they have to have the same name. And, I think they have to be in the same menu either (not sure since I almost never create a menu-array)

Clunietp
Jan 3rd, 2000, 12:08 AM
DO NOT use different names in a control array, that will defeat the purpose of creating it!

You can't code for an event where different commands have different names. If you want to do that, you are unnecessarily giving each different item an index, and you will only give yourself more of a headache trying to match up the index with the control name when you are coding.