65.9K
CodeProject is changing. Read more.
Home

myComboBox

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.50/5 (8 votes)

Jul 25, 2006

CPOL
viewsIcon

42024

downloadIcon

2514

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.