Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming

Reply
 
LinkBack Thread Tools
Old 01-26-09   #1 (permalink)
Luck : 10pts
 
Licht's Avatar
 
amd ati

Join Date: Mar 2007
Location: Fl, US
Posts: 12,837
Blog Entries: 3

Rep: 364 Licht is a proven memberLicht is a proven memberLicht is a proven memberLicht is a proven member
Unique Rep: 241
Trader Rating: 0
Default [C#]How to prevent custom user input in Combo Boxes. (Visual Studio 2008)

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.

System: Uzicht #4.5
CPU
Phenom II X4 920
Motherboard
Gigabyte 790X AM2+
Memory
6GB Kingston DDR2 667MHZ
Graphics Card
HD4850 + HD3870
Hard Drive
4x WD1600AAJS RAID0
Sound Card
X-Fi Extreme Gamer Professional
Power Supply
OCZ Game-X-Stream 700w
Case
NZXT Black Steel
CPU cooling
Xigmatec Rifle
GPU cooling
Stock Saphire 3870 Cooling
OS
Windows 7 Ultimate x86-x64
Monitor
Samsung SyncMaster 19"Wide

Last edited by Licht : 01-26-09 at 08:20 PM
Licht is offline Overclocked Account Licht's Gallery   Reply With Quote
Old 01-26-09   #2 (permalink)
.
 
BiG O's Avatar
 
intel nvidia

Join Date: Jul 2007
Location: Virginia
Posts: 3,590

Trader Rating: 4
Default

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.

System: My System
CPU
Q6700
Motherboard
Gigabyte p35-DS4
Memory
8GB Crucial Ballistix DDR2-800 (4x2GB)
Graphics Card
BFG 8800GTS 512MB g92
Hard Drive
2X 500GB Seagate Barracuda 7,200 RPM SATA RAID 0
Sound Card
Razer Barracuda AC-1 7.1
Power Supply
ABS 700W Modular
Case
Antec 900
CPU cooling
Apogee GTZ
GPU cooling
Stock
OS
Vista Ultimate x64 SP1, Xubuntu 8.10, Windows 7
Monitor
Hanns-G 28" & Dell 19" widescreen
BiG O is offline Overclocked Account   Reply With Quote
Old 01-26-09   #3 (permalink)
Luck : 10pts
 
Licht's Avatar
 
amd ati

Join Date: Mar 2007
Location: Fl, US
Posts: 12,837
Blog Entries: 3

Rep: 364 Licht is a proven memberLicht is a proven memberLicht is a proven memberLicht is a proven member
Unique Rep: 241
Trader Rating: 0
Default

Quote:
Originally Posted by BiG O View Post
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.
Sorry i usually language tag my topic names. Forgot to this time.

System: Uzicht #4.5
CPU
Phenom II X4 920
Motherboard
Gigabyte 790X AM2+
Memory
6GB Kingston DDR2 667MHZ
Graphics Card
HD4850 + HD3870
Hard Drive
4x WD1600AAJS RAID0
Sound Card
X-Fi Extreme Gamer Professional
Power Supply
OCZ Game-X-Stream 700w
Case
NZXT Black Steel
CPU cooling
Xigmatec Rifle
GPU cooling
Stock Saphire 3870 Cooling
OS
Windows 7 Ultimate x86-x64
Monitor
Samsung SyncMaster 19"Wide
Licht is offline Overclocked Account Licht's Gallery   Reply With Quote
Old 01-26-09   #4 (permalink)
Performance
 
linskingdom's Avatar
 
intel nvidia

Join Date: Jun 2007
Location: In Office
Posts: 13,419

Rep: 3340 linskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a guru
Unique Rep: 1406
Trader Rating: 7
Default

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..


System: QD65D45
CPU
E8500
Motherboard
Gigabyte EP45-UD3P

Last edited by linskingdom : 01-26-09 at 08:27 PM
linskingdom is offline Overclocked Account linskingdom's Gallery   Reply With Quote
Old 01-26-09   #5 (permalink)
.
 
BiG O's Avatar
 
intel nvidia

Join Date: Jul 2007
Location: Virginia
Posts: 3,590

Trader Rating: 4
Default

Quote:
Originally Posted by linskingdom View Post
In order to do so, you need to change the dropdownstyle of the combo box to DropDownList.
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.

System: My System
CPU
Q6700
Motherboard
Gigabyte p35-DS4
Memory
8GB Crucial Ballistix DDR2-800 (4x2GB)
Graphics Card
BFG 8800GTS 512MB g92
Hard Drive
2X 500GB Seagate Barracuda 7,200 RPM SATA RAID 0
Sound Card
Razer Barracuda AC-1 7.1
Power Supply
ABS 700W Modular
Case
Antec 900
CPU cooling
Apogee GTZ
GPU cooling
Stock
OS
Vista Ultimate x64 SP1, Xubuntu 8.10, Windows 7
Monitor
Hanns-G 28" & Dell 19" widescreen
BiG O is offline Overclocked Account   Reply With Quote
Old 01-26-09   #6 (permalink)
Performance
 
linskingdom's Avatar
 
intel nvidia

Join Date: Jun 2007
Location: In Office
Posts: 13,419

Rep: 3340 linskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a guru
Unique Rep: 1406
Trader Rating: 7
Default

Quote:
Originally Posted by BiG O View Post
genius. I also kind of hate you because you beat me to it.
I am just lucky few seconds ahead of you.
__________________
Push to the limit one more time..


System: QD65D45
CPU
E8500
Motherboard
Gigabyte EP45-UD3P
linskingdom is offline Overclocked Account linskingdom's Gallery   Reply With Quote
Old 01-26-09   #7 (permalink)
Luck : 10pts
 
Licht's Avatar
 
amd ati

Join Date: Mar 2007
Location: Fl, US
Posts: 12,837
Blog Entries: 3

Rep: 364 Licht is a proven memberLicht is a proven memberLicht is a proven memberLicht is a proven member
Unique Rep: 241
Trader Rating: 0
Default

Quote:
Originally Posted by linskingdom View Post
I am just lucky few seconds ahead of you.
It didn't work.

System: Uzicht #4.5
CPU
Phenom II X4 920
Motherboard
Gigabyte 790X AM2+
Memory
6GB Kingston DDR2 667MHZ
Graphics Card
HD4850 + HD3870
Hard Drive
4x WD1600AAJS RAID0
Sound Card
X-Fi Extreme Gamer Professional
Power Supply
OCZ Game-X-Stream 700w
Case
NZXT Black Steel
CPU cooling
Xigmatec Rifle
GPU cooling
Stock Saphire 3870 Cooling
OS
Windows 7 Ultimate x86-x64
Monitor
Samsung SyncMaster 19"Wide
Licht is offline Overclocked Account Licht's Gallery   Reply With Quote
Old 01-26-09   #8 (permalink)
Performance
 
linskingdom's Avatar
 
intel nvidia

Join Date: Jun 2007
Location: In Office
Posts: 13,419

Rep: 3340 linskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a guru
Unique Rep: 1406
Trader Rating: 7
Default

Quote:
Originally Posted by Licht View Post
It didn't work.
Any error message?
__________________
Push to the limit one more time..


System: QD65D45
CPU
E8500
Motherboard
Gigabyte EP45-UD3P
linskingdom is offline Overclocked Account linskingdom's Gallery   Reply With Quote
Old 01-26-09   #9 (permalink)
4.0ghz
 
error10's Avatar
 
intel nvidia

Join Date: Sep 2008
Location: Manchester, New Hampshire
Posts: 9,737
Blog Entries: 4

Rep: 1167 error10 is a starerror10 is a starerror10 is a starerror10 is a starerror10 is a starerror10 is a starerror10 is a starerror10 is a starerror10 is a star
Unique Rep: 708
Hardware Reviews: 1
Trader Rating: 45
Default

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.

System: Underground
CPU
Core i7 920
Motherboard
ASUS P6T6 WS Revolution
Memory
3x2GB Corsair Dominator DDR3-1600
Graphics Card
EVGA 9800 GT SC 512MB
Hard Drive
4x MBA3147RC RAID5
Sound Card
Intel ICH10 HD Audio / ADI Codec
Power Supply
BFG ES-800
Case
Thermaltake Armor VA8003BWS
CPU cooling
TRUE Lapped + Scythe Slip Stream 1900
GPU cooling
Stock
OS
Fedora 10 x86_64
Monitor
HP w19b
3 Million+ Folding at Home points
error10 is offline Overclocked Account error10's Gallery   Reply With Quote
Old 01-26-09   #10 (permalink)
Performance
 
linskingdom's Avatar
 
intel nvidia

Join Date: Jun 2007
Location: In Office
Posts: 13,419

Rep: 3340 linskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a gurulinskingdom is a guru
Unique Rep: 1406
Trader Rating: 7
Default

Quote:
Originally Posted by error10 View Post
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.
I think he wants the user select the option from the list. For instance, the state list etc.
__________________
Push to the limit one more time..


System: QD65D45
CPU
E8500
Motherboard
Gigabyte EP45-UD3P
linskingdom is offline Overclocked Account linskingdom's Gallery   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -5. The time now is 11:36 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.17023 seconds with 9 queries