Font is one of the factors that are responsible to make your websites look good on the system. All might be aware of the font properties that we use in day to day activities while working in the computer. Using different font properties the websites or the documents that you prepare can be made to look more attractive. The changing font property, color and alignment on run time in VB.Net will act as a guide in providing the details of the font properties that are present in VB.Net. This will be one of the applications that can help in understanding the users about the font dialog properties in VB.Net.
The different font properties that are available in VB.Net are as follows:
- Color: The selected font color will be set through this property.
- Font: The selected font will be set through this property.
- AllowVerticalFonts: Indicates whether the dialog box sets or gets the vertical font.
- FontMustExist: Error condition will be displayed if the user selects the font that is not available.
- Maxsize: This property specifies the maximum point the user can select.
- MinSize: This property specifies the minimum point the user can select.
- ShowApply: This property sets the value if the dialog box contains apply button.
- ShowColor: Sets the value if the dialog box displays the color choice.
- ShowHelp: This property sets the value if the dialog box contains help button.
This is a simple program which explains to change style, Fore color, and alignment at Runtime using VB.NET. FontDialog tool to change font properties, ColorDialog property tool to change color of the text in multiline textbox.
To change Textbox font on runtime:
TextBox1.Font = FontDialog1.Font
To change Text color on runtime:
TextBox1.ForeColor = ColorDialog1.Color
To change Text alignment on runtime:
Align right side : TextBox1.TextAlign = HorizontalAlignment.Right
Align Left side : TextBox1.TextAlign = HorizontalAlignment.Left
Align Centerside : TextBox1.TextAlign = HorizontalAlignment.Center
Download project files:🔥171 Views