Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. how to create dynamic textbox object [modified]

how to create dynamic textbox object [modified]

Scheduled Pinned Locked Moved Visual Basic
csharphelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moomoooomoo
    wrote on last edited by
    #1

    greetings to you all, guys i need your help very badly.. on how to create a dynamic textbox object in runtime... using VB.NET 2005 the code below suppossedly can display 5 textbox, but sad to say i cannot see any textbox in my form. Can someone help me on this: For xcnt = 0 To 4 Dim text As New TextBox text.Visible = True text.Location = New Point(33 + xcnt, 27) text.Size = New Size(104, 21) Next pls help here... thank you so much.... links/codes are highly appreciated..:-D -- modified at 6:21 Monday 24th September, 2007

    start a new beginning in every ending; thats what life for......

    A 1 Reply Last reply
    0
    • M moomoooomoo

      greetings to you all, guys i need your help very badly.. on how to create a dynamic textbox object in runtime... using VB.NET 2005 the code below suppossedly can display 5 textbox, but sad to say i cannot see any textbox in my form. Can someone help me on this: For xcnt = 0 To 4 Dim text As New TextBox text.Visible = True text.Location = New Point(33 + xcnt, 27) text.Size = New Size(104, 21) Next pls help here... thank you so much.... links/codes are highly appreciated..:-D -- modified at 6:21 Monday 24th September, 2007

      start a new beginning in every ending; thats what life for......

      A Offline
      A Offline
      Ajay k_Singh
      wrote on last edited by
      #2

      Main problem is that you are not adding text boxes to Forms control collection. Try following code – --------------------Start Code--------------- Dim xcnt As Integer Dim x As Integer x = 20 Dim txt As TextBox For xcnt = 0 To 4 txt = New TextBox Me.Controls.Add(txt) ‘you were missing this line txt.Location = New Point(33 + x, 27 + x) x += 25 Next -------------------Code End--------------------- I hope this helps:). -Dave.

      Dave Traister, ComponentOne LLC. www.componentone.com

      M 1 Reply Last reply
      0
      • A Ajay k_Singh

        Main problem is that you are not adding text boxes to Forms control collection. Try following code – --------------------Start Code--------------- Dim xcnt As Integer Dim x As Integer x = 20 Dim txt As TextBox For xcnt = 0 To 4 txt = New TextBox Me.Controls.Add(txt) ‘you were missing this line txt.Location = New Point(33 + x, 27 + x) x += 25 Next -------------------Code End--------------------- I hope this helps:). -Dave.

        Dave Traister, ComponentOne LLC. www.componentone.com

        M Offline
        M Offline
        moomoooomoo
        wrote on last edited by
        #3

        thank you sir dave, your help is very highly appreciated.. looking forward to you soon, many thanks.. :-D

        start a new beginning in every ending; thats what life for......

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups