diff --git a/DarkUI/Controls/DarkComboBox.cs b/DarkUI/Controls/DarkComboBox.cs
new file mode 100644
index 0000000..8e480de
--- /dev/null
+++ b/DarkUI/Controls/DarkComboBox.cs
@@ -0,0 +1,162 @@
+using DarkUI.Config;
+using DarkUI.Icons;
+using System;
+using System.ComponentModel;
+using System.Drawing;
+using System.Windows.Forms;
+using DarkUI.Extensions;
+
+namespace DarkUI.Controls
+{
+ public class DarkComboBox : ComboBox
+ {
+ public DarkComboBox() : base()
+ {
+ SetStyle(ControlStyles.OptimizedDoubleBuffer |
+ ControlStyles.ResizeRedraw |
+ ControlStyles.UserPaint, true);
+
+ DrawMode = DrawMode.OwnerDrawVariable;
+
+ base.FlatStyle = FlatStyle.Flat;
+ base.DropDownStyle = ComboBoxStyle.DropDownList;
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new Color ForeColor { get; set; }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new Color BackColor { get; set; }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new FlatStyle FlatStyle { get; set; }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new ComboBoxStyle DropDownStyle { get; set; }
+
+ public new void Invalidate()
+ {
+ base.Invalidate();
+ }
+
+ protected override void OnTextChanged(EventArgs e)
+ {
+ Invalidate();
+
+ base.OnTextChanged(e);
+ }
+
+ protected override void OnTextUpdate(EventArgs e)
+ {
+ Invalidate();
+
+ base.OnTextUpdate(e);
+ }
+
+ protected override void OnSelectedValueChanged(EventArgs e)
+ {
+ Invalidate();
+
+ base.OnSelectedValueChanged(e);
+ }
+
+ protected override void OnDrawItem(DrawItemEventArgs e)
+ {
+ var g = e.Graphics;
+ var rect = e.Bounds;
+
+ var textColor = Colors.LightText;
+ var fillColor = Colors.LightBackground;
+
+ if ((e.State & DrawItemState.Selected) == DrawItemState.Selected ||
+ (e.State & DrawItemState.Focus) == DrawItemState.Focus ||
+ (e.State & DrawItemState.NoFocusRect) != DrawItemState.NoFocusRect)
+ fillColor = Colors.BlueSelection;
+
+ using (var b = new SolidBrush(fillColor))
+ {
+ g.FillRectangle(b, rect);
+ }
+
+ if (e.Index >= 0 && e.Index < Items.Count)
+ {
+ var text = Items[e.Index].ToString();
+
+ using (var b = new SolidBrush(textColor))
+ {
+ var textOffsetX = 2;
+ var textOffsetY = 2;
+
+ var modRect = new Rectangle(rect.Left + textOffsetX,
+ rect.Top + textOffsetY,
+ rect.Width - textOffsetX,
+ rect.Height - textOffsetY);
+
+ var stringFormat = new StringFormat
+ {
+ LineAlignment = StringAlignment.Center,
+ Alignment = StringAlignment.Near,
+ Trimming = StringTrimming.EllipsisCharacter
+ };
+
+ g.DrawString(text, Font, b, modRect, stringFormat);
+ }
+ }
+ }
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ var g = e.Graphics;
+ var rect = new Rectangle(0, 0, ClientSize.Width, ClientSize.Height);
+
+ var textColor = Colors.LightText;
+ var borderColor = Colors.GreySelection;
+ var fillColor = Colors.LightBackground;
+
+ if (Focused && TabStop)
+ borderColor = Colors.BlueHighlight;
+
+ using (var b = new SolidBrush(fillColor))
+ {
+ g.FillRectangle(b, rect);
+ }
+
+ using (var p = new Pen(borderColor, 1))
+ {
+ var modRect = new Rectangle(rect.Left, rect.Top, rect.Width - 1, rect.Height - 1);
+ g.DrawRectangle(p, modRect);
+ }
+
+ var icon = ScrollIcons.scrollbar_arrow_hot;
+ g.DrawImageUnscaled(icon,
+ rect.Right - icon.Width - (Consts.Padding / 2),
+ (rect.Height / 2) - (icon.Height / 2));
+
+ var text = SelectedItem != null ? SelectedItem.ToString() : Text;
+
+ using (var b = new SolidBrush(textColor))
+ {
+ var textOffsetX = 2;
+ var textOffsetY = 2;
+
+ var modRect = new Rectangle(rect.Left + textOffsetX,
+ rect.Top + textOffsetY,
+ rect.Width - textOffsetX,
+ rect.Height - textOffsetY);
+
+ var stringFormat = new StringFormat
+ {
+ LineAlignment = StringAlignment.Center,
+ Alignment = StringAlignment.Near,
+ Trimming = StringTrimming.EllipsisCharacter
+ };
+
+ g.DrawString(text, Font, b, modRect, stringFormat);
+ }
+ }
+ }
+}
diff --git a/DarkUI/DarkUI.csproj b/DarkUI/DarkUI.csproj
index 6f4914b..ef05429 100644
--- a/DarkUI/DarkUI.csproj
+++ b/DarkUI/DarkUI.csproj
@@ -50,6 +50,9 @@
Component
+
+ Component
+
diff --git a/Example/Forms/Dialogs/DialogControls.Designer.cs b/Example/Forms/Dialogs/DialogControls.Designer.cs
index 90598b8..6b319df 100644
--- a/Example/Forms/Dialogs/DialogControls.Designer.cs
+++ b/Example/Forms/Dialogs/DialogControls.Designer.cs
@@ -39,6 +39,9 @@ namespace Example
this.lstTest = new DarkUI.Controls.DarkListView();
this.pnlMessageBox = new DarkUI.Controls.DarkSectionPanel();
this.panel1 = new System.Windows.Forms.Panel();
+ this.panel6 = new System.Windows.Forms.Panel();
+ this.darkComboBox1 = new DarkUI.Controls.DarkComboBox();
+ this.darkTitle4 = new DarkUI.Controls.DarkTitle();
this.panel5 = new System.Windows.Forms.Panel();
this.darkRadioButton3 = new DarkUI.Controls.DarkRadioButton();
this.darkRadioButton2 = new DarkUI.Controls.DarkRadioButton();
@@ -59,6 +62,7 @@ namespace Example
this.pnlListView.SuspendLayout();
this.pnlMessageBox.SuspendLayout();
this.panel1.SuspendLayout();
+ this.panel6.SuspendLayout();
this.panel5.SuspendLayout();
this.panel4.SuspendLayout();
this.panel3.SuspendLayout();
@@ -150,6 +154,7 @@ namespace Example
//
// panel1
//
+ this.panel1.Controls.Add(this.panel6);
this.panel1.Controls.Add(this.panel5);
this.panel1.Controls.Add(this.panel4);
this.panel1.Controls.Add(this.panel3);
@@ -161,6 +166,45 @@ namespace Example
this.panel1.Size = new System.Drawing.Size(220, 374);
this.panel1.TabIndex = 0;
//
+ // panel6
+ //
+ this.panel6.Controls.Add(this.darkComboBox1);
+ this.panel6.Controls.Add(this.darkTitle4);
+ this.panel6.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel6.Location = new System.Drawing.Point(10, 285);
+ this.panel6.Name = "panel6";
+ this.panel6.Size = new System.Drawing.Size(200, 100);
+ this.panel6.TabIndex = 13;
+ //
+ // darkComboBox1
+ //
+ this.darkComboBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(49)))), ((int)(((byte)(51)))), ((int)(((byte)(53)))));
+ this.darkComboBox1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.darkComboBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
+ this.darkComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.darkComboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.darkComboBox1.ForeColor = System.Drawing.Color.Gainsboro;
+ this.darkComboBox1.FormattingEnabled = true;
+ this.darkComboBox1.Items.AddRange(new object[] {
+ "Item 1",
+ "Item 2",
+ "Item 3",
+ "Item 4"});
+ this.darkComboBox1.Location = new System.Drawing.Point(0, 26);
+ this.darkComboBox1.Name = "darkComboBox1";
+ this.darkComboBox1.Size = new System.Drawing.Size(200, 24);
+ this.darkComboBox1.TabIndex = 17;
+ this.darkComboBox1.Text = "Item 1";
+ //
+ // darkTitle4
+ //
+ this.darkTitle4.Dock = System.Windows.Forms.DockStyle.Top;
+ this.darkTitle4.Location = new System.Drawing.Point(0, 0);
+ this.darkTitle4.Name = "darkTitle4";
+ this.darkTitle4.Size = new System.Drawing.Size(200, 26);
+ this.darkTitle4.TabIndex = 16;
+ this.darkTitle4.Text = "Additional controls";
+ //
// panel5
//
this.panel5.Controls.Add(this.darkRadioButton3);
@@ -331,6 +375,7 @@ namespace Example
this.pnlMessageBox.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
+ this.panel6.ResumeLayout(false);
this.panel5.ResumeLayout(false);
this.panel5.PerformLayout();
this.panel4.ResumeLayout(false);
@@ -365,5 +410,8 @@ namespace Example
private DarkTitle darkTitle1;
private DarkTitle darkTitle2;
private DarkTitle darkTitle3;
+ private System.Windows.Forms.Panel panel6;
+ private DarkTitle darkTitle4;
+ private DarkComboBox darkComboBox1;
}
}
\ No newline at end of file
diff --git a/Example/Forms/Dialogs/DialogControls.resx b/Example/Forms/Dialogs/DialogControls.resx
index 16202c3..8a7b1de 100644
--- a/Example/Forms/Dialogs/DialogControls.resx
+++ b/Example/Forms/Dialogs/DialogControls.resx
@@ -118,6 +118,13 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ iVBORw0KGgoAAAANSUhEUgAAAAkAAAAFCAYAAACXU8ZrAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1
+ MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAvSURBVBhXY4iJiflPCDP8//8f
+ r0KQPFgRLoUwObgiEMamAIRRFIEwuoL///8zAAC5cW+geGnZqAAAAABJRU5ErkJggg==
+
+
AAABAAEAECAAAAEAIAA8AQAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAAFz