public DropDownButton(IVisualStyleComboBox comboBox) { m_comboBox = comboBox; if (Application.RenderWithVisualStyles) { SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); } else { Image = ResourceHelper.ComboMenuArrowIcon; // no text, just the image BackColor = Color.FromKnownColor(KnownColor.Control); } Width = PreferredWidth; }
internal ComboTextBox(IVisualStyleComboBox comboBox) { m_comboBox = comboBox; // Allows it to be big unless client shrinks it. Font = new Font(this.Font.Name, (float)100.0); if (Application.RenderWithVisualStyles) { SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); BackColor = Color.Transparent; } else { // And, if not changed, it's background color is white. BackColor = SystemColors.Window; } }