Copy content from one TextBox to several others

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • joslu
    New Member
    • May 2013
    • 1

    Copy content from one TextBox to several others

    I want to copy a value from one textbox to several others, like:

    TextBox2.Value = Textbox1.Value
    TextBox3.Value = Textbox1.Value
    TextBox4.Value = Textbox1.Value
    etc up to 30
    How can this be done by using a For Next loop?

    For i = 1 to 30
    "TextBox" & i & ".Value" = TextBox1.Value
    Next i
  • Developer4ever
    New Member
    • May 2013
    • 1

    #2
    Try something like this,
    Code:
    string myTxt = TextBox1.Value
    Dim allTxt As New List(Of Control)
       For Each txt As TextBox In FindControlRecursive(allTxt, Me, GetType(TextBox))
           txt.Value = myTxt
       Next

    Comment

    Working...