Results 1 to 4 of 4

Thread: textbox name when create programmically

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2003
    Posts
    219

    Question textbox name when create programmically

    When I create textboxes at run time, how do I know which textbox is which? Here's the code, for example.

    Dim txtResult As New TextBox()

    pnlAppResult.SuspendLayout()
    With txtAward
    .Width = 80
    .Height = awdH
    .Location = New Point(awdX, awdY)
    .AutoSize = True
    .Multiline = True
    '.Text = plcHolder
    .BackColor = System.Drawing.Color.White
    .ReadOnly = True
    .Visible = True
    .Show()
    End With
    pnlAppResult.Controls.Add(txtAward)
    pnlAppResult.ResumeLayout(True)
    This text box is created base on how many results are generated from the database. My problem is if I want to work with the first created textbox, which name do I use to work with because all of the created textboxes are create with the name txtAward. Please help.

    Many thanks in advance!

    Chong

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Feb 2003
    Posts
    219

    Question textbox name when create programmically

    Sorry, this line
    COLOR=red]Dim txtAward As New TextBox()[/COLOR] should be Dim txtResult As New TextBox()[

    Thanks!

    Chong

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    You never specified a name for your textbox . Set .Name Property to your control created at runtime .

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Feb 2003
    Posts
    219
    Thanks! I'll give that a try.

    Chong

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