refering to controls using variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dkalsow

    refering to controls using variables

    Good Morning,

    I have a text box called txtbox1. Is there a way I can refer to it sorta
    like.

    dim intI as integer = 1
    me.txtbox & intI = "testing"

    Thanks in advance!
  • Cor Ligthert

    #2
    Re: refering to controls using variables

    Dkalsow

    Set the references to it in an array
    something as
    dim textboxarray as textbox() = new textbox() {textbox1,textb ox2}

    You can reach them than with

    myfield = textoboxarray(1 ).text

    Did you know that there is a newsgroup

    Microsoft.publi c.dotnet.langua ges.vb

    There this kind of questions are very common.

    I hope however that this answer fits you and when you want to know more feel
    free to post it in this or the newsgroup I showed you?

    Cor

    "dkalsow" <dkalsow@discus sions.microsoft .com>[color=blue]
    > Good Morning,
    >
    > I have a text box called txtbox1. Is there a way I can refer to it sorta
    > like.
    >
    > dim intI as integer = 1
    > me.txtbox & intI = "testing"
    >
    > Thanks in advance![/color]


    Comment

    Working...