Results 1 to 3 of 3

Thread: Menu Control Array

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 1999
    Location
    Avinashi, TamilNadu, India
    Posts
    20

    Post

    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?

  2. #2
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    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)

  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width