17-10-12, 05:58 PM
كاتب الموضوع : Boutemine Oualid
السلام عليكم و رحمة الله و بركاتهفيبي .نت
كود :
Function CreateIcon(string s) As Icon
Dim bmp As New Bitmap(16, 16)
Dim brush As New SolidBrush(Color.Black)
Dim g As Graphics = Graphics.FromImage(bmp)
g.DrawString(s, New Font("Arial", 10f), brush, 0, 0)
g.Dispose()
Dim hIcon As IntPtr = bmp.GetHicon()
Return Icon.FromHandle(hIcon)
End Function
كود :
public static Icon CreateIcon(string s)
{
Bitmap bmp = new Bitmap(16, 16);
SolidBrush brush = new SolidBrush(Color.Black);
Graphics g = Graphics.FromImage(bmp);
g.DrawString(s, new Font("Arial", 10f), brush, 0, 0);
g.Dispose();
IntPtr hIcon = bmp.GetHicon();
return Icon.FromHandle(hIcon);
}