Click here to Skip to main content
15,886,806 members
Articles / Programming Languages / C#
Article

myComboBox

Rate me:
Please Sign up or sign in to vote.
2.50/5 (8 votes)
25 Jul 2006CPOL 41.5K   2.5K   24   4
how to make the standard combobox to drop custom controls

Sample Image - myComboBox.gif

Introduction

I needed to drop a custom control when the comboBox button is pressed, so i adapt the comboBox to drop what i want. This article explain how to make a standard ComboBox to drop a custom control. You can use that method to drop a dataGridView in a datagridview if you need. I need to override the WndProc method of the ComboBox to stop the ComboBox to display the standard list.When the comboBox button is pressed, the message is captured and canceled and is shown a ToolStripDropDown control that contain the custom control. The custom control is dropped as a ToolStripDropDown, so we need a ToolStripControlHost to host the control that we want to drop. Have fun!

References

Refer to the MSDN topic for more details.

License

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


Written By
Web Developer
Romania Romania
Student

Comments and Discussions

 
QuestionThanks! Pin
Member 98879286-Mar-13 0:26
Member 98879286-Mar-13 0:26 
GeneralThanks Pin
Archambault2-Mar-07 5:14
Archambault2-Mar-07 5:14 
GeneralRe: Thanks Pin
funygel4-Mar-07 9:22
funygel4-Mar-07 9:22 
GeneralRe: Thanks Pin
Archambault5-Mar-07 3:15
Archambault5-Mar-07 3:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.