473,505 Members | 15,036 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Based on input number Creating textboxes and lablel

6 New Member
Hi everyone!
i am newbie to visual basic.net, and I'm having a headache to do this. Assuming we ask the user to input a number of guests and based on that number of guests..we creating textbox or label or something to ask guests' name, guests' age.
For Example:
User will put in our textbox 2 guests so we will firt ask for the first guest what is his name, what is his age and then ask for the second guests what is his name, what is his age. I wonder how we can design a form to ask for this since the guests that user put in is unknown until the users tell us. (how many textbox and lable we have to implement in our form for guests' name, guests' age since we do not know how many guests will be)
Mar 13 '12 #1
4 2107
Guido Geurs
767 Recognized Expert Contributor
This call in VB6 creates commands at runtime: "How to create buttons dynamically inside grid element".
Just set an element with index = 0 in the form and LOAD a number of this elements at runtime.
Use the index to identify and work with them.
Mar 14 '12 #2
Killer42
8,435 Recognized Expert Expert
I'm pretty sure MS did away with control arrays in VB.Net.
Mar 14 '12 #3
huskar
6 New Member
Thank all!! i got an idea but a brand new problem :(
Mar 15 '12 #4
rekedtechie
51 New Member
Expand|Select|Wrap|Line Numbers
  1. 'this can be done by using string arrays
  2.  
  3. 'put variables in your global declaration
  4. Dim x As Integer
  5. Dim n As Integer = 0
  6. Dim strNames[] As String
  7.  
  8. 'put this code in your command button to set number of Guest
  9. x = txtboxGuestNumber.Text
  10.  
  11. 'put this code in your command button to add name.
  12. If n = x Then
  13. msgbox "Guest limit occured!"
  14. else
  15. strNames[n] = txtName.text
  16. n = n+1
  17. End If
  18.  
  19. 'put this code in command button to view arrays
  20. For i = 0 to x
  21. Debug.Print strNames[i]
  22. Next i
  23.  
  24. 'good luck! =)
  25.  
Mar 19 '12 #5

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

Similar topics

4
11402
by: T. Wintershoven | last post by:
Hello, I have a few textboxes placed on a SSTab control devided over 3 tabs Is there a way to clear all textboxes in one time in stead of one by one. Someone told me "Use for each item...
2
10065
by: Briand | last post by:
In my previous posting I failed miserably, to give enough information to get my difficulty apparent. So to start again. I want to create textboxes dynamically in VB.NET. This is not a web...
11
3098
by: ian.davies52 | last post by:
Is there anything I can do about the apparent limit on the number of textboxes that have calculations as their control source on a form or report in ms-access? I have a query that pulls together...
4
1581
by: Jason M | last post by:
Hi, Im very new to c#, so forgive me if this is a really stupid question. Im trying to create a form for entering purchase requests. For each line item I have a quantity, a description unit cost...
10
1884
by: Tony | last post by:
Is there a recommended way to have a form that is a list of textboxes from a sql table based on a username that then puts the captured data back into the db? I have a table |userid|skill|level|....
4
1566
by: Ed | last post by:
I have a new requisite from a client that wants to give the user the option to about a databind based on number of returned rows. if ds.rows.count < 1000 then dg.databind() etc. They want...
4
1461
by: rseanbarnes | last post by:
Hello, I am designing a program using Visual Basic 2005 Express Edition that will ask the user for a number between 1 and 50. When the button on the form is clicked, another form (Form2) opens...
2
1835
by: osakthivel | last post by:
hello sir, I have one problem.I want to createtexboxes dynamically using javascript when textbox onblur event.after creating textboxes if i submit the form the dynamically created...
1
2848
by: Greg Smith | last post by:
Is there a way to mask input for a TextBox? I would like to have TextBoxes that accept only: - numbers - currency Any help is greatly appreciated.
4
1356
by: ashwinigopi | last post by:
Hi I am a fresher to .net just taking classes for .net. I got a task whic i have a basic idea but dont know how to proceed. Heres the task create a form with a textbox and two buttons 'Show' and...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7303
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7018
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.