I am trying to create a custom combo box that inherits from ComboBox and supports all 3 DropDownStyles, but I keep getting an anomaly in the way the forms designer display my cutom ComboBox when it is set to DropDownStyle.Simple.
When the inherited ComboBox is set to DropDownStyle.Simple the Designer Resizes it improperly to include the DropDown(I think).
The Inherited ComboBox does this before adding any Code other than the Designer generated Code.
To repeat this weird beahvior(I'm Using Visual Studio 2005 Pro)
1. Create a new Windows Form Project
2. Create a new User Control
3. Changes the class definition of the UserControl to Inherit from ComboBox instead of UserControl
4. Comment out the line AutoScaleMode line in the .designer.cs file, likebelow, because the ComboBox doesn't Support the AutoScaleMode property.
5. Build the Project so your control will show in the designer.
6. Swith to View Designer of the Form and Drop the new user control into the form from the Toolbox
7. Change the DropDownStyle of the new UserControl to Simple and BAM unwanted resizing.
//this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
Any help is greatly appreciated!