in vc.net...
private void comboBox1_DrawI tem(object sender, DrawItemEventAr gs e)
{
Bitmap bmp = new Bitmap(e.Bounds .Width,e.Bounds .Height,e.Graph ics);
Graphics g = Graphics.FromIm age(bmp);
g.FillRectangle (new SolidBrush(e.Ba ckColor), new
Rectangle(0,0,b mp.Width,bmp.He ight));
g.DrawString(co mboBox1.Items[e.Index].ToString(),e.F ont ,new
SolidBrush(e.Fo reColor), new Point(28,(bmp.H eight-e.Font.Height)/2));
g.DrawImage(ima geList1.Images[e.Index], new Rectangle(new
Point(6,0),new Size(16,16)));
e.Graphics.Draw Image(bmp,e.Bou nds.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_DrawI tem(ByVal sender As Object, ByVal e As
DrawItemEventAr gs) Handles ComboBox1.DrawI tem
Dim bmp As Bitmap = New
Bitmap(e.Bounds .Width,e.Bounds .Height,e.Graph ics)
Dim g As Graphics = Graphics.FromIm age(bmp)
g.FillRectangle (New SolidBrush(e.Ba ckColor), New
Rectangle(0,0,b mp.Width,bmp.He ight))
g.DrawString(co mboBox1.Items(e .Index).ToStrin g(),e.Font ,New
SolidBrush(e.Fo reColor), New Point(28,(bmp.H eight-e.Font.Height)/2))
g.DrawImage(ima geList1.Images( e.Index), New Rectangle(New
Point(6,0),New Size(16,16)))
e.Graphics.Draw Image(bmp,e.Bou nds.X,e.Bounds. Y)
End Sub
does ne 1 know how to fix problem?
regards,
supra
private void comboBox1_DrawI tem(object sender, DrawItemEventAr gs e)
{
Bitmap bmp = new Bitmap(e.Bounds .Width,e.Bounds .Height,e.Graph ics);
Graphics g = Graphics.FromIm age(bmp);
g.FillRectangle (new SolidBrush(e.Ba ckColor), new
Rectangle(0,0,b mp.Width,bmp.He ight));
g.DrawString(co mboBox1.Items[e.Index].ToString(),e.F ont ,new
SolidBrush(e.Fo reColor), new Point(28,(bmp.H eight-e.Font.Height)/2));
g.DrawImage(ima geList1.Images[e.Index], new Rectangle(new
Point(6,0),new Size(16,16)));
e.Graphics.Draw Image(bmp,e.Bou nds.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_DrawI tem(ByVal sender As Object, ByVal e As
DrawItemEventAr gs) Handles ComboBox1.DrawI tem
Dim bmp As Bitmap = New
Bitmap(e.Bounds .Width,e.Bounds .Height,e.Graph ics)
Dim g As Graphics = Graphics.FromIm age(bmp)
g.FillRectangle (New SolidBrush(e.Ba ckColor), New
Rectangle(0,0,b mp.Width,bmp.He ight))
g.DrawString(co mboBox1.Items(e .Index).ToStrin g(),e.Font ,New
SolidBrush(e.Fo reColor), New Point(28,(bmp.H eight-e.Font.Height)/2))
g.DrawImage(ima geList1.Images( e.Index), New Rectangle(New
Point(6,0),New Size(16,16)))
e.Graphics.Draw Image(bmp,e.Bou nds.X,e.Bounds. Y)
End Sub
does ne 1 know how to fix problem?
regards,
supra
Comment