Here is a basic control that i put together in a few minutes but you will need to make properties like private int selctedindex and tie into listbox selected index and so forth but a decent start
using System;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
namespace YourNameHere
{
public class AdvancedComboBox : Panel
{
private System.Windows.Forms.TextBox textBox1 = new TextBox();
private System.Windows.Forms.Panel panel1 = new Panel();
private System.Windows.Forms.ListBox listBox1 = new ListBox();
public AdvancedComboBox()
{
InitializeComponent();
listBox1.Visible = false;
listBox1.Items.AddRange(new object[] { "Apple", "Pear", "Orange", "Grape", "Lemon", "Lime" });
panel1.BackgroundImage = setButtonOff();
}
private void InitializeComponent()
{
this.Controls.AddRange(new Control[] { textBox1, panel1, listBox1 });
this.panel1.Location = new System.Drawing.Point(128, 59);
this.panel1.Size = new System.Drawing.Size(15, 20);
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown);
this.panel1.MouseLeave += new System.EventHandler(this.panel1_MouseLeave);
this.panel1.MouseHover += new System.EventHandler(this.panel1_MouseHover);
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(28, 79);
this.listBox1.Size = new System.Drawing.Size(115, 95);
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
this.listBox1.MouseLeave += new System.EventHandler(this.listBox1_MouseLeave);
this.textBox1.Location = new System.Drawing.Point(27, 59);
this.textBox1.Size = new System.Drawing.Size(100, 20);
}
private void listBox1_MouseLeave(object sender, EventArgs e)
{
listBox1.Visible = false;
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
textBox1.Text = listBox1.SelectedItem.ToString();
listBox1.Visible = false;
}
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
if (listBox1.Visible)
{ listBox1.Visible = false; }
else { listBox1.Visible = true; }
}
private void panel1_MouseHover(object sender, EventArgs e)
{
panel1.BackgroundImage = setButtonOver();
}
private Image setButtonOff()
{
string base64String = "iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAARUlEQVQokWP8//8/A4ng1duPjGRoY2BgYCJDz6g2bIAFqygjIyOmIHJUYbcNMzLRRHA6Elkdpin4/AZRjTUZjSYuamkDAD0zINGCHX3yAAAAAElFTkSuQmCC";
byte[] base64byte = Convert.FromBase64String(base64String);
MemoryStream ms = new MemoryStream(base64byte);
return Image.FromStream(ms);
}
private void panel1_MouseLeave(object sender, EventArgs e)
{
panel1.BackgroundImage = setButtonOff();
}
private Image setButtonOver()
{
string base64String = "iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAAGuqymWAAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAAd0SU1FB9sDGQA2Npg6IGUAAAB0SURBVCjPY1z54z8DAwMDAwMTAwNDOAcjAwMDI1wMxoJQjCgUHDAxoAIUeSYsKtFtQVeGbgE+y/DJQewhbCZOuQd/cdunwEySW5ABC1YXQhzBhMZHZlArXIgNazKNHDTaWHBJIAc7cgATFSThHNgVDImQBAAVrjj7k1ImuAAAAABJRU5ErkJggg==";
byte[] base64byte = Convert.FromBase64String(base64String);
MemoryStream ms = new MemoryStream(base64byte);
return Image.FromStream(ms);
}
}
}