|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming | |
[C#]How to prevent custom user input in Combo Boxes. (Visual Studio 2008)
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | |||||||||||||
|
Luck : 10pts
![]() |
I want to use a combo box for user input. However i want to force the user to select one of the predefined choices available. Making it so they cannot type in their own text. Anyone know how to do this? I'm stumped.
__________________
Last edited by Licht : 01-26-09 at 08:20 PM |
|||||||||||||
|
|
|
|
#2 (permalink) | |||||||||||||
|
.
![]() |
I assume you're using C#? Since that's what you usually use. Shouldn't matter too much, just checking in case I figure it out with code instead of using a menu in VS 08.
__________________
Imaging with Windows PE Please keep the OCN Terms of Service in mind when posting.
|
|||||||||||||
|
|
|
|
#3 (permalink) | |||||||||||||
|
Luck : 10pts
![]() |
Sorry i usually language tag my topic names. Forgot to this time.
__________________
|
|||||||||||||
|
|
|
|
#4 (permalink) | |||
|
Performance
![]() |
In order to do so, you need to change the dropdownstyle of the combo box to DropDownList. In the init, you can add the following line to ensure the first item show in the list.
this.comboBox1.SelectedIndex = 0;
__________________
Push to the limit one more time.. ![]()
Last edited by linskingdom : 01-26-09 at 08:27 PM |
|||
|
|
|
|
#5 (permalink) | |||||||||||||
|
.
![]() |
genius. I also kind of hate you because you beat me to it.
__________________
Imaging with Windows PE Please keep the OCN Terms of Service in mind when posting.
|
|||||||||||||
|
|
|
|
#7 (permalink) | |||||||||||||
|
Luck : 10pts
![]() |
__________________
|
|||||||||||||
|
|
|
|
#9 (permalink) | |||||||||||||
|
4.0ghz
![]() |
I must be missing something. Why are you using a combo box if you don't want people typing in their own inputs? After all, that's the whole point of a combo box. Try using a list box instead.
__________________
The Ice Stone has melted! I did error10's Windows Challenge and I now am an MCSE: Minesweeper Consultant and Solitaire Expert! ![]()
|
|||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|