By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,805 Members | 1,349 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,805 IT Pros & Developers. It's quick & easy.

insert the text boxes at run time

100+
P: 138
is it possible to insert the no, of text boxes at the run time. i want the messages to be in the text boxes rather than message box.
Apr 3 '07 #1
Share this Question
Share on Google+
4 Replies


vijaydiwakar
100+
P: 579
is it possible to insert the no, of text boxes at the run time. i want the messages to be in the text boxes rather than message box.
yes
for that create ctrl array and use following code
Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Form_Load()
  3. Load Text1(1)
  4. Text1(1).Visible = True
  5. Text1(1).Left = Me.Left
  6. Text1(1).Top = Me.Top
  7. End Sub
  8.  
  9.  
Apr 3 '07 #2

100+
P: 138
hi
i have to show the values of no. of record in the text boxes. when i click any button, the values should be displayed in the text boxes one by one. now i am showing the values in the same text box. when i click any button, the previous value disappears and the new value is displayed. i want to store all the values shown in the text box and to display too.
as we can show the values of the recordset in the datagrid, i want to show it in the textboxes. in the datagrid, the no. of rows increases as the data increases, likewise i want to show the data in the textbox and increase the no. as the data increases.
Apr 4 '07 #3

vijaydiwakar
100+
P: 579
hi
i have to show the values of no. of record in the text boxes. when i click any button, the values should be displayed in the text boxes one by one. now i am showing the values in the same text box. when i click any button, the previous value disappears and the new value is displayed. i want to store all the values shown in the text box and to display too.
as we can show the values of the recordset in the datagrid, i want to show it in the textboxes. in the datagrid, the no. of rows increases as the data increases, likewise i want to show the data in the textbox and increase the no. as the data increases.
see its not a good practise
but still ua may handle this case using xml file or notepad file
link each record with the index of text box and some other related details
Apr 4 '07 #4

Expert 5K+
P: 8,434
i have to show the values of no. of record in the text boxes. when i click any button, the values should be displayed in the text boxes one by one. now i am showing the values in the same text box. when i click any button, the previous value disappears and the new value is displayed. i want to store all the values shown in the text box and to display too.
as we can show the values of the recordset in the datagrid, i want to show it in the textboxes. in the datagrid, the no. of rows increases as the data increases, likewise i want to show the data in the textbox and increase the no. as the data increases.
If you are using VB6, then as vijaydiwakar pointed out in his first response, you can use a control array. This allows you to add more elements (in this case, textboxes) at runtime.

If you are using VB.Net then I have no idea how you add controls at runtime.

One thing to keep in mind. If you know the maximum number of textboxes you will need, you could create them all at design time, then just set their Visible property to hide or show them.
Apr 5 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.