Change font for any control in VB.NET
Every controls from Windows.Forms in Visual Basic could get a new font using this easy formula :
New System.Drawing.Font("Minya Nouvelle", 12, FontStyle.Bold) |
First argument is the name of the font. Second argument is the size and finally if the text if normal, italic or bold.
Of course, you could do much more but what else could you do. The basic stuffs are those 3 arguments. So if you wish to apply a change to any control, you have to create a new font. You can�t change a particular property because the property Font is Read-only. For example, you can�t switch from normal to bold directly without re-creating a new font. If you wish to change the font an existing control, you need to get all the existing properties and apply the new changes.
To change a font from Normal to Bold:
TreeView1.Font = New System.Drawing.Font("Minya Nouvelle", 12, FontStyle.Normal) |
After :
TreeView1.Font = New System.Drawing.Font("Minya Nouvelle", 12, FontStyle.Bold) |
Download Sample: SampleBasicProgram
Previous Post : add icon in TreeView
Previous Post : TreeView with recursivity
Previous Post : TreeView with recursivity
Update Contact :
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email : Fajarudinsidik@gmail.com
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email: Fajarudinsidik@gmail.com
atau Kirimkan Private messanger melalui email dengan klik tombol order dibawah ini :