how use a common code for all text box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chandru8
    New Member
    • Sep 2007
    • 145

    how use a common code for all text box

    HI ALL
    txttype.SelStar t = 0
    'txttype.SelLen gth = Len(txttype.Tex t)
    FOR EACH TEXTBOX I NEED TO REPLICATE THE ABOVE CODE.
    HOW CAN I USE A COMMON CODE FOR ALL THE TEXT BOXES
    IN MY PROJECT IAM USING OVER 109 TEXT BOXES
    IS THIS WAY TO REPLICATE THE CODE OR
    ANY SOLUTION


    THANKS FOR ALL
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    you need to use control array of textboxes.

    Comment

    • jg007
      Contributor
      • Mar 2008
      • 283

      #3
      if you have them all in a groupbox or tabpage similar you could use something like -

      Code:
      Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      
              For Each cont As Control In GroupBox1.Controls
                  cont.Text = "Test"
              Next
      
          End Sub
      you could do more sorting out by control type if you need to, also if you remove the text all the user would see if the faint line around the labels

      Comment

      Working...