![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
|
Combo Box
I can't figure out how to keep the text in the box from being edited
__________________
|
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 376
Rep Power: 0
![]() |
Try changing the DropDownStyle property to DropDownList. This can either be done through the designer or via code.
__________________
I am Addicted to Linux! |
|
|
|
|
|
#3 |
|
Expert Programmer
|
Thanks.
__________________
|
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 376
Rep Power: 0
![]() |
No problem, I came accoss the same problem a couple months ago
__________________
I am Addicted to Linux! |
|
|
|
|
|
#5 |
|
Expert Programmer
|
I've searched for this and can't find any help. I am trying to make a text box equal something if a certain item is choosen. I don't know if that makes sense but if it does could you help me?
__________________
|
|
|
|
|
|
#6 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 376
Rep Power: 0
![]() |
Open up your form designer where your combo box is located and double click the combo box and it will create and event. This event will be triggered every time there is a new option selected in the combo box, so now you can put an if statement in that event that checks what has been selected, and then you can set your text box if it meets the right criteria. I think this is what you are looking for, if not please provide a bit more info.
__________________
I am Addicted to Linux! |
|
|
|
|
|
#7 |
|
Expert Programmer
|
yeah thats what i mean but when i try this if statement
[php] if(this.Equals("COMPUTERS")) displaybox.Text = "computers"; [/php] it does not display in the text box
__________________
|
|
|
|
|
|
#8 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 376
Rep Power: 0
![]() |
Don't go "this.Equals", "this" means the form you are on; use the name of your combobox.
if(comboBox.Text == "COMPUTERS")
displaybox.Text = "computers";
__________________
I am Addicted to Linux! |
|
|
|
|
|
#9 |
|
Expert Programmer
|
Thanks again
__________________
|
|
|
|
|
|
#10 |
|
Expert Programmer
|
Maybe its just me but finding any info on combo boxes is really hard. I would like to add a text file to combo boxes collection and i can, but it is just one really long line. How can i get it to have a new line for each new line in the text file?
__________________
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 3 language combo. | Nebula | Coder's Corner Lounge | 9 | Dec 19th, 2005 1:34 PM |
| anoying problem with a combo box | cloud- | Visual Basic | 12 | May 28th, 2005 1:20 PM |
| Java Combo Boxes | Vengeance | Java | 0 | May 4th, 2005 9:02 AM |
| What are advantages of Data Combo and data list over simple combo and list box? | sham | Visual Basic | 1 | Apr 12th, 2005 4:11 AM |
| combo box in form.. | cloud- | HTML / XHTML / CSS | 5 | Mar 15th, 2005 3:21 PM |