Results 1 to 3 of 3

Thread: array

  1. #1

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    array

    hi,
    I have textbox1, textbox2 at design time how to make this textbox into array?

    popskie

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: array

    You cannot actually do it at design time as such. You need to declare your array as a member variable:
    Code:
    private TextBox[] myArray = new TextBox[2];
    and then assign the TextBoxes to the array in the Load event handler:
    Code:
    this.myArray[0] = this.textbox1;
    this.myArray[1] = this.textbox2;
    Then you can refer to the TextBoxes via the array elements anywhere else in your code.

  3. #3

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: array

    thanks for the help.

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