A problem in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KfirShtober
    New Member
    • Jul 2007
    • 11

    A problem in C#

    Hello again...
    This is my problem :
    I have a lot of textboxes in names : d1, d2, d3, d4, d5, d6, d7, d8 until d31.
    I want to make a for in this way:
    for(int x=1;31>x;x++){
    d[x].Text = x;

    }

    ==== > I mean d[x] = d1; and then d[x] = d2.
    *it is not an array

    Can someone help me please?
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by KfirShtober
    Hello again...
    This is my problem :
    I have a lot of textboxes in names : d1, d2, d3, d4, d5, d6, d7, d8 until d31.
    I want to make a for in this way:
    for(int x=1;31>x;x++){
    d[x].Text = x;

    }

    ==== > I mean d[x] = d1; and then d[x] = d2.
    *it is not an array

    Can someone help me please?
    Why not create an array of textboxes instead then you can access them easier?

    Comment

    • KfirShtober
      New Member
      • Jul 2007
      • 11

      #3
      Originally posted by r035198x
      Why not create an array of textboxes instead then you can access them easier?
      How can I create array of textboxes?

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by KfirShtober
        How can I create array of textboxes?
        The same way you would create an array of integers.

        Comment

        • KfirShtober
          New Member
          • Jul 2007
          • 11

          #5
          Oh thanks=)
          I like this forum:D

          Comment

          Working...