Results 1 to 3 of 3

Thread: CREATE controll array for label on ide

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,743

    CREATE controll array for label on ide

    I just hvae in my project a labels similar:
    label1
    label2
    ...
    labelnnn

    How to create a label array via ide, and at to the end of operation:

    labe1(0)
    label(2)
    ...
    label(nnn)
    Last edited by luca90; Feb 9th, 2025 at 10:20 AM.

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,435

    Re: CREATE controll array for label on ide

    Place a label on the form.
    Then in the properties set the index to 0.
    Now you have a control array.
    If you copy and paste this control on the form then for each new instance the index will be incremented

  3. #3
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,788

    Re: CREATE controll array for label on ide

    Quote Originally Posted by luca90 View Post
    I just hvae in my project a labels similar:
    label1
    label2
    ...
    labelnnn

    How to create a label array via ide, and at to the end of operation:

    labe1(0)
    label(2)
    ...
    label(nnn)
    Select Label1 and in Name delete last digit. Select Label2 and in Name delete last digit and accept creating a control array. Select Label3 and in Name delete last digit and it will auto-join the control array (no extra action needed) and so on for all the rest of the labels.

    Now you have a giant control array called Label. That's what I usually do with my forms too but name the control array labLabel -- one control array to rule them all "anonymous" labels.

    Whenever I need to address a label in code (change caption dynamicly, whatever) I always rename it to labSomeUsefulName so to exclude it from the giant control array mess.

    cheers,
    </wqw>

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