![]() |
Combo Box
I can't figure out how to keep the text in the box from being edited
|
Try changing the DropDownStyle property to DropDownList. This can either be done through the designer or via code.
|
Thanks.
|
No problem, I came accoss the same problem a couple months ago
|
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?
|
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.
|
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 |
Don't go "this.Equals", "this" means the form you are on; use the name of your combobox.
:
if(comboBox.Text == "COMPUTERS") |
Thanks again
|
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?
|
| All times are GMT -5. The time now is 1:04 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC