Multiple Textboxes in same array
-
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???
(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
-
(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
-
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! :)
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