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. Multiple Textboxes in same array

Multiple Textboxes in same array

Scheduled Pinned Locked Moved Visual Basic
questiondata-structures
4 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
    mpalmati
    wrote on last edited by
    #1

    How can I get txtbox1.Text and txtbox2.Text data into the same array, without hand-coding the values into a separate arra:mad:y???

    I 1 Reply Last reply
    0
    • M mpalmati

      How can I get txtbox1.Text and txtbox2.Text data into the same array, without hand-coding the values into a separate arra:mad:y???

      I Offline
      I Offline
      Ian Darling
      wrote on last edited by
      #2

      (VB.NET) Try a Datagrid and using data binding on the array instead if you have a lot of textboxes? (VB6) Use a control array, and then you can use a loop to copy across to the array. YMMV -- Ian Darling

      M 1 Reply Last reply
      0
      • I Ian Darling

        (VB.NET) Try a Datagrid and using data binding on the array instead if you have a lot of textboxes? (VB6) Use a control array, and then you can use a loop to copy across to the array. YMMV -- Ian Darling

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

        I have 12 textboxes that I need as one array,12 others as a separate array. I think the datagrid might work, but I've never used that control. Can you point me to an article (beginner level). Thanks for your help! :)

        I 1 Reply Last reply
        0
        • M mpalmati

          I have 12 textboxes that I need as one array,12 others as a separate array. I think the datagrid might work, but I've never used that control. Can you point me to an article (beginner level). Thanks for your help! :)

          I Offline
          I Offline
          Ian Darling
          wrote on last edited by
          #4

          Well, there's probably an article on CP somewhere, but it's really simple - bung a datagrid on your form, then call SetDataBinding on it with your array: ' Example - display an array of 3 items in a datagrid Dim myArray as String(3) = { "Hi", "Hello", "Bonjour" } ' Haven't tested this, but should work ok DataGrid1.SetDataBinding(myArray, "") If you need something more complicated (eg, multiple columns), use a DataTable instead of an Array. All of this is documented in MSDN anyway. -- Ian Darling

          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