Jump to content

I am writing a program for class and I need to make it so that an input box will come up for what ever amount of a number is entered into a textbox.  The program is a paint price estimation and need to have an input box pop up and ask for the square feet of each room after the user enters number of rooms in a text box.  I just need the code to make multiple boxes show after reading the number in the textbox and then a way to combine all of their numbers to one output to run through my equation as a single Square Feet number.

Link to comment
https://linustechtips.com/topic/333819-vbnet-input-box-question/
Share on other sites

Link to post
Share on other sites

I'll assume this is using WinForms. In your form you can add controls with

Me.Controls.Add(control)

So you can create new controls in a loop and then add them to the form.

For i As Integer = 0 To roomNumber    Dim control As New TextBox()    ...    Me.Controls.Add(control)Next

In between is where you'd configure the TextBox or do anything else you need.

 

edit: Just re-read your post and it sounds like you are asking for pop up messages that accept input, not actually adding things to the form. Sorry if that's the case. I'll write another answer.

Link to comment
https://linustechtips.com/topic/333819-vbnet-input-box-question/#findComment-4529755
Share on other sites

Link to post
Share on other sites

I'll assume this is using WinForms. In your form you can add controls with

Me.Controls.Add(control)

So you can create new controls in a loop and then add them to the form.

For i As Integer = 0 To roomNumber    Dim control As New TextBox()    ...    Me.Controls.Add(control)Next

In between is where you'd configure the TextBox or do anything else you need.

 

edit: Just re-read your post and it sounds like you are asking for pop up messages that accept input, not actually adding things to the form. Sorry if that's the case. I'll write another answer.

Hey that is the case.  I need to have boxes accept information and use it in an equation.

Link to comment
https://linustechtips.com/topic/333819-vbnet-input-box-question/#findComment-4529814
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×