public Form1()
{
InitializeComponent();
sfComboBox1.DropDownButton.Paint += DropDownButton_Paint;
}
private void DropDownButton_Paint(object sender, PaintEventArgs e)
{
Font myFont = new System.Drawing.Font("Helvetica",16, FontStyle.Italic);
e.Graphics.Clear(Color.White);
e.Graphics.FillRectangle(Brushes.LightGray, new RectangleF(0, 0, sfComboBox1.DropDownButton.Width, sfComboBox1.DropDownButton.Height));
e.Graphics.DrawString("#", myFont, Brushes.Black, 1, 3);
} |
private void DropDownButton_Paint(object sender, PaintEventArgs e)
{
Image image = Image.FromFile( Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Images/icon.png"));
Font myFont = new System.Drawing.Font("Helvetica",16, FontStyle.Italic);
e.Graphics.Clear(Color.White);
e.Graphics.FillRectangle(Brushes.WhiteSmoke, new RectangleF(0, 0, sfComboBox1.DropDownButton.Width, sfComboBox1.DropDownButton.Height));
//e.Graphics.DrawString("#", myFont, Brushes.Black, 1, 3);
e.Graphics.DrawImage(image, 1, 7,sfComboBox1.DropDownButton.Height-17,sfComboBox1.DropDownButton.Height-15);
} |