0% found this document useful (0 votes)
5 views

Develop An Application Using Color Dialog Control.

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Develop An Application Using Color Dialog Control.

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

4/21/24, 6:20 PM VB.

NET Font Dialog Box - Javatpoint

Home VB.NET .Net C# ADO.NET ASP.NET SQL Server Java F# AngularJS

https://www.javatpoint.com/vb-net-font-dialog-box 1/11
4/21/24, 6:20 PM VB.NET Font Dialog Box - Javatpoint

VB.NET Font Dialog Box


The Font Dialog Box allows the user to select the font family, style, and size for the text in an
application. However, a user can also select the font color and apply the current setting to the
selected text of the control by clicking the Apply button.

Let's create a Font Dialog box in the VB.NET Windows form using the following steps.

Step 1. We need to drag the Font Dialog box from the toolbox and drop it to the Windows
form, as shown below.

https://www.javatpoint.com/vb-net-font-dialog-box 2/11
4/21/24, 6:20 PM VB.NET Font Dialog Box - Javatpoint

Step2: Once the Font Dialog is added to the form, we can set various properties of the Font by
clicking on the Font Dialog box.

https://www.javatpoint.com/vb-net-font-dialog-box 3/11
4/21/24, 6:20 PM VB.NET Font Dialog Box - Javatpoint

Properties of Font Dialog

There are following properties of the Font Dialog Box in the VB.NET.

Properties Description

ShowApply The ShowApply property sets a value representing whether you want
to display the Apply button on the dialog box.

ShowEffects The ShowEffects property is used to set various effects on the text
such as strikethrough, text color, and underline options by setting
values on the FontDialog box.

Font The Font property is used to get or set the selected font to display
changes.

Container The Container property is used to get the IContainer that contains the
Component of the Font Dialog Box.

AllowVerticalFonts The AllowverticalFonts property is used to set or get a value that


represents whether the Font dialog box displays the horizontal and
vertical fonts or displays only horizontals fonts.

AllowScriptChange The AllowScriptChange property is used to set a value that allows the
user to change the character specified in the Script combo box to
show a character set other than the currently displayed character.

ScriptOnly The ScriptOnly property is used to set a value that allows the user to
select only the font, the character set of the symbol, and the ANSI
character from the dialog box.

https://www.javatpoint.com/vb-net-font-dialog-box 4/11
4/21/24, 6:20 PM VB.NET Font Dialog Box - Javatpoint

ShowHelp The ShowHelp property is used to set a value representing whether


the Help button should be displayed in the dialog box.

MaxSize The MaxSize property gets or sets a value that allows the user to
select only the maximum point size character.

Options It is used to initialize FontDialog by obtaining values.

Methods of Font Dialog

Method Description

Equals() The Equals() method is used to check whether the current or defined
object is the same.

OnHelpRequest() It is used to call the HelpRequest event in the dialog box.

Reset() The Reset() method is used to reset all changes to their default values.

Dispose() The Dispose() method is used to free all resources used by the Control
or the component in the Dialog Box.

RunDialog() It is used to override a derived class to create a common dialog box.

ShowDialog() The ShowDialog () method is used to run a common dialog box with the
default setting.

CreateObjRef() The CreateObjRef () method is used to create an object that contains all
related information to initialize a proxy that can communicate with a
remote object.

Events of Font Dialog

Events Description

Disposed When control or component is terminated by calling the Dispose() method, a


Dispose event occurs.

HelpRequest When a user clicks the Help button of the dialog box, the HelpRequest event
is called.

https://www.javatpoint.com/vb-net-font-dialog-box 5/11
4/21/24, 6:20 PM VB.NET Font Dialog Box - Javatpoint

Apply When a user clicks on the Apply button of the Font dialog box, an apply
event occurs.

Let's create a simple program to display the Font dialog box in the VB.NET Windows Forms.

FontDialog.vb

Public Class FontDialog


Private Sub FontDialog_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Text = "javaTpoint.com" 'set the title name for the Windows form.
Button1.Text = "Change Font" 'Set the name of button1
Button2.Text = "Exit" 'name of button2
Label1.Text = "Uses of Font"
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
FontDialog1.ShowColor = True
If FontDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
TextBox1.Font = FontDialog1.Font 'Change the font of the selected string
TextBox1.ForeColor = FontDialog1.Color 'Change the color of selected string
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Me.Dispose() 'Terminate the program
End Sub
End Class

https://www.javatpoint.com/vb-net-font-dialog-box 6/11
4/21/24, 6:20 PM VB.NET Font Dialog Box - Javatpoint

Output:

Write some text in TextArea, as shown below.

Select the string and click the 'Change Font' button; it opens the Font window. In the Font
window, we can change the size, font, and font style of the selected string.

https://www.javatpoint.com/vb-net-font-dialog-box 7/11
4/21/24, 6:20 PM VB.NET Font Dialog Box - Javatpoint

After setting the font, font style, size, and color, etc. on the Font dialog box, it shows the
formatted string, as shown below.

← Prev Next →

Youtube For Videos Join Our Youtube Channel: Join Now

https://www.javatpoint.com/vb-net-font-dialog-box 8/11
4/21/24, 6:20 PM VB.NET Font Dialog Box - Javatpoint

Feedback

Send your Feedback to [email protected]

Help Others, Please Share

Learn Latest Tutorials

Splunk tutorial SPSS tutorial Swagger T-SQL tutorial


tutorial
Splunk SPSS Transact-SQL
Swagger

Tumblr tutorial React tutorial Regex tutorial Reinforcement


learning tutorial
Tumblr ReactJS Regex
Reinforcement
Learning

R Programming RxJS tutorial React Native Python Design


tutorial tutorial Patterns
RxJS
R Programming React Native Python Design
Patterns

Python Pillow Python Turtle Keras tutorial


tutorial tutorial
Keras
Python Pillow Python Turtle

Preparation

Aptitude Logical Verbal Ability Interview


Reasoning Questions
Aptitude Verbal Ability
Reasoning Interview Questions

https://www.javatpoint.com/vb-net-font-dialog-box 9/11
4/21/24, 6:20 PM VB.NET Font Dialog Box - Javatpoint

Company
Interview
Questions
Company Questions

Trending Technologies

Artificial AWS Tutorial Selenium Cloud


Intelligence tutorial Computing
AWS
Artificial Selenium Cloud Computing
Intelligence

Hadoop tutorial ReactJS Data Science Angular 7


Tutorial Tutorial Tutorial
Hadoop
ReactJS Data Science Angular 7

Blockchain Git Tutorial Machine DevOps


Tutorial Learning Tutorial Tutorial
Git
Blockchain Machine Learning DevOps

B.Tech / MCA

DBMS tutorial Data Structures DAA tutorial Operating


tutorial System
DBMS DAA
Data Structures Operating System

Computer Compiler Computer Discrete


Network tutorial Design tutorial Organization and Mathematics
Architecture Tutorial
Computer Network Compiler Design
Computer Discrete
Organization Mathematics

https://www.javatpoint.com/vb-net-font-dialog-box 10/11
4/21/24, 6:20 PM VB.NET Font Dialog Box - Javatpoint

Ethical Hacking Computer Software html tutorial


Graphics Tutorial Engineering
Ethical Hacking Web Technology
Computer Graphics Software
Engineering

Cyber Security Automata C Language C++ tutorial


tutorial Tutorial tutorial
C++
Cyber Security Automata C Programming

Java tutorial .Net Python tutorial List of


Framework Programs
Java Python
tutorial
Programs
.Net

Control Data Mining Data


Systems tutorial Tutorial Warehouse
Tutorial
Control System Data Mining
Data Warehouse

https://www.javatpoint.com/vb-net-font-dialog-box 11/11

You might also like