VB Tutorial
Tools
Free Downloads
Free Link Directory

Basics
Data Types
Windows Forms
Buttons
Check Box
Text Box
Combo Box
Radio Buttons
Progress Bar
Color & Font Dialogs
Open & Save Dialogs
Process Control

More Complex Examples
Audio Player
Rotating Rectangle

 


Set fonts color with colordialog in vb.net

Color & Font Dialogs

ColorDialogs:
ColorDialogs are used to set a specific color to an object. The easiest way to demonstrate it is with this simple example:
Create a new project. From the Toolbox menu create a Button and a ColorDialog. Add the following text:

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ColorDialog1.ShowDialog()
Me.BackColor = ColorDialog1.Color
End Sub
End Class

FontDialogs:
Just like ColorDialogs, FontDialogs are used to set the desired font to an object. You can also set the fonts color.
Create a new project. From the Toolbox menu create a Button and a FontDialog. Add the following code:

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = "My Font Looks Like This!"
FontDialog1.ShowColor = True
FontDialog1.ShowDialog()
Label1.Font = FontDialog1.Font
Label1.ForeColor = FontDialog1.Color
End Sub
End Class

Run the application. You will see that when you press the button, the FontDialog opens. In the FontDialog you can select the font with futures like "Bold", "Italic", size and color.
If you liked this article then Please Thumb This Up with a short review - Stumble It!
Continue to the next page.


Email us at: info@pro2visual.com

Get your Website Listed on our Free Link Banner Directory
Advertise your site with your own unique link banner we will also provide text links to your site.

 

Popular Articles

Moving a borderless form in vb.net

ComboBox1.Items.Add

Link Progress Bar with Timer in vb.net

How to open a folder using the process control

Start Vb.net programming. No get rich quick scam

How to Convert the Date Format

Click here for Industry Leading Development Softwa