Click here to Skip to main content
15,885,886 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using visual studio 2010. Now i have create simple project. In this project i am using combo box(Drop down box). When i click the arrow then only it shows the list of items. But i want, if click anywhere in the combo box, it should show the list of items in combo box.
Is it possible? If it is possible means please guide me..


When we click the combo box arrow button it show the list items. But i want where ever click in the combo box(Not only the arrow) i want show the list items.
Now can you understand? Sorry i am very weak in English.


Thanks in advance.
Posted
Updated 7-Oct-13 3:14am
v2
Comments
BulletVictim 7-Oct-13 8:58am    
Please rephrase your question. It is very unclear as to what you are wanting to do?
Vijaydhas 7-Oct-13 9:07am    
When we click the combo box arrow button it show the list items. But i want where ever click in the combo box(Not only the arrow) i want show the list items.
Now can you understand? Sorry i am very weak in English.
Vijaydhas 7-Oct-13 9:19am    
I got it..

private void comboBox1_Click(object sender, EventArgs e)
{
comboBox1.DroppedDown = true;

}

It's working..

Thank you for your instant replay. I am happy with your reply. Once again thank you.
♥…ЯҠ…♥ 7-Oct-13 9:04am    
Out of curious.... What is the point of asking this question?
Vijaydhas 7-Oct-13 9:08am    
When we click the combo box arrow button it show the list items. But i want where ever click in the combo box(Not only the arrow) i want show the list items.
Now can you understand? Sorry i am very weak in English.

1 solution

Hi,

this is pretty simnple, just change the ComboBox DropDownStyle Property from Property window to Dropdownlist Or
C#
private void Form1_Load(object sender, EventArgs e)
       {
           comboBox1.DropDownStyle=ComboBoxStyle.DropDownList;
       }
 
Share this answer
 
Comments
Vijaydhas 7-Oct-13 9:25am    
Oh.. Thank you.. It's working.. That's why i like the code project and code project experts..!!
Thank you...


And i tried this myself.. It is also working..!!
private void comboBox1_Click(object sender, EventArgs e)
{
comboBox1.DroppedDown = true;

}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900