S
Supra
in vc.net...
private void comboBox1_DrawItem(object sender, DrawItemEventArgs e)
{
Bitmap bmp = new Bitmap(e.Bounds.Width,e.Bounds.Height,e.Graphics);
Graphics g = Graphics.FromImage(bmp);
g.FillRectangle(new SolidBrush(e.BackColor), new
Rectangle(0,0,bmp.Width,bmp.Height));
g.DrawString(comboBox1.Items[e.Index].ToString(),e.Font ,new
SolidBrush(e.ForeColor), new Point(28,(bmp.Height-e.Font.Height)/2));
g.DrawImage(imageList1.Images[e.Index], new Rectangle(new
Point(6,0),new Size(16,16)));
e.Graphics.DrawImage(bmp,e.Bounds.X,e.Bounds.Y);
}
convert to vb.net ................and i still got error problem for
drawstring and drawimage. i set drawmode to onwerdrawfixed and
dropdownstyle to dropdownlist
Private Sub comboBox1_DrawItem(ByVal sender As Object, ByVal e As
DrawItemEventArgs) Handles ComboBox1.DrawItem
Dim bmp As Bitmap = New
Bitmap(e.Bounds.Width,e.Bounds.Height,e.Graphics)
Dim g As Graphics = Graphics.FromImage(bmp)
g.FillRectangle(New SolidBrush(e.BackColor), New
Rectangle(0,0,bmp.Width,bmp.Height))
g.DrawString(comboBox1.Items(e.Index).ToString(),e.Font ,New
SolidBrush(e.ForeColor), New Point(28,(bmp.Height-e.Font.Height)/2))
g.DrawImage(imageList1.Images(e.Index), New Rectangle(New
Point(6,0),New Size(16,16)))
e.Graphics.DrawImage(bmp,e.Bounds.X,e.Bounds.Y)
End Sub
does ne 1 know how to fix problem?
regards,
supra
private void comboBox1_DrawItem(object sender, DrawItemEventArgs e)
{
Bitmap bmp = new Bitmap(e.Bounds.Width,e.Bounds.Height,e.Graphics);
Graphics g = Graphics.FromImage(bmp);
g.FillRectangle(new SolidBrush(e.BackColor), new
Rectangle(0,0,bmp.Width,bmp.Height));
g.DrawString(comboBox1.Items[e.Index].ToString(),e.Font ,new
SolidBrush(e.ForeColor), new Point(28,(bmp.Height-e.Font.Height)/2));
g.DrawImage(imageList1.Images[e.Index], new Rectangle(new
Point(6,0),new Size(16,16)));
e.Graphics.DrawImage(bmp,e.Bounds.X,e.Bounds.Y);
}
convert to vb.net ................and i still got error problem for
drawstring and drawimage. i set drawmode to onwerdrawfixed and
dropdownstyle to dropdownlist
Private Sub comboBox1_DrawItem(ByVal sender As Object, ByVal e As
DrawItemEventArgs) Handles ComboBox1.DrawItem
Dim bmp As Bitmap = New
Bitmap(e.Bounds.Width,e.Bounds.Height,e.Graphics)
Dim g As Graphics = Graphics.FromImage(bmp)
g.FillRectangle(New SolidBrush(e.BackColor), New
Rectangle(0,0,bmp.Width,bmp.Height))
g.DrawString(comboBox1.Items(e.Index).ToString(),e.Font ,New
SolidBrush(e.ForeColor), New Point(28,(bmp.Height-e.Font.Height)/2))
g.DrawImage(imageList1.Images(e.Index), New Rectangle(New
Point(6,0),New Size(16,16)))
e.Graphics.DrawImage(bmp,e.Bounds.X,e.Bounds.Y)
End Sub
does ne 1 know how to fix problem?
regards,
supra