-
Jun 29th, 2020, 11:49 AM
#1
Thread Starter
Junior Member
-
Jun 29th, 2020, 12:39 PM
#2
Re: How to get an InputBox control
There is something called the InputBox, but it is so terribly restrictive that there is virtually no real world use for it. I suspect that you don't want that anyways....even if you think you might.
So, what you want could be one of two things.
1) A different form that pops up with a textbox on it (or some other type of control, if the data you want them to input isn't text).
2) Since you have plenty of space on the form you are showing, perhaps you could just put the textbox or other control on there and toggle the Visibility property on or off, as you wish.
Either way, you'd want to do that in the SelectedIndexChanged event handler for the combobox.
My usual boring signature: Nothing
-
Jun 29th, 2020, 12:41 PM
#3
Re: How to get an InputBox control
An inoutbox isn't a control... it's a method baked into VB that you can call that will display a dialog asking the user for input. If you want to simply display information, then use MessageBox ... unless you meant something else...
-tg
-
Jun 29th, 2020, 01:00 PM
#4
Thread Starter
Junior Member
Re: How to get an InputBox control
yes I want it to ask user for an input of their grades whiles button 2 is inactive .
-
Jun 29th, 2020, 01:04 PM
#5
Thread Starter
Junior Member
Re: How to get an InputBox control
I prefer your second option but does it mean that for every value i select there should be textbox controls to allow the user an input?
-
Jun 29th, 2020, 04:27 PM
#6
Re: How to get an InputBox control
Not a different textbox, just one.
However, there may be a better approach. I can't quite read the text in that control. If you have a series of items, and you want the user to be able to enter some value for each of the items, then perhaps the ComboBox isn't the right control. An alternative you might consider would be a DataGridView, where the first column is the item, and the second column would allow the user to enter a value. You couldn't collapse a DGV the way you can with a combobox, but it would allow the user to see the text and the values next to each other in two columns, which might be more appealing.
The combobox and textbox seems a better route if the user will make one selection, enter a value, then leave the form. You could also have a textbox and for each selection, the user would see the value associated with that selection (if there is one), so that they could click on each one in turn and see the values. There are times when that would be nicer than the DGV approach. Of course, then you'd have to consider custom coloring of the items in the combobox to indicate whether or not they had a value, yet, but that's a whole different matter.
My usual boring signature: Nothing
-
Jun 29th, 2020, 04:42 PM
#7
Re: How to get an InputBox control
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 30th, 2020, 04:25 AM
#8
Lively Member
Re: How to get an InputBox control
HTML Code:
Dim Message, Title, Default, MyValue
Message = "Enter a value between 1 and 3" ' Set prompt.
Title = "InputBox Demo" ' Set title.
Default = "1" ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)
' Use Helpfile and context. The Help button is added automatically.
MyValue = InputBox(Message, Title, , , , "DEMO.HLP", 10)
' Display dialog box at position 100, 100.
MyValue = InputBox(Message, Title, Default, 100, 100)
-
Jun 30th, 2020, 09:15 AM
#9
Thread Starter
Junior Member
Re: How to get an InputBox control
-
Jun 30th, 2020, 12:53 PM
#10
Thread Starter
Junior Member
Re: [RESOLVED] How to get an InputBox control
thanks to everyone it helped
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|