Introduction
You may think you have seen this one before, and you will be partially correct. I wanted a ComboBox like dropdown control that I could drop other controls onto and arrange them at design time. Because the ToolStripDropDown
couldn't be handled directly at design time and I didn't fully understand it yet, I made the DropDownPanel[^] which is a User Control that Inherits Panel
and has a fancy size change routine. It is a good control, and works well for certain situations, but it still wasn't a true dropdown like I wanted. Then, I got the idea you will find here. I decided to create a separate article for this control because I felt there are enough different techniques in each to not just update and replace the DropDownPanel article.
The ToolStripDropDown
had two main stumbling points. First, you cannot see it on the design surface, and second, it contains only one control at a time. You can put a bunch of controls on a Panel
and then put that "one" Panel
control in the ToolStripDropDown
, but then, you have these extra controls laying around your design surface, cluttering it up, or you have to hide them somewhere. Then, I got the idea to hide it in a DropDownContainer
, and show it like I did in the DropDownPanel
control at Design Time, and in theToolStripDropDown
at Run Time, depending on the DesignMode
property.
Copyright :http://www.codeproject.com/KB/static/DropDownContainer.aspx
->Read More...
0 Comments:
Đăng nhận xét