Getting Started with WinForms FontDropDownList
This article shows how you can start using RadFontDropDownList.
Adding Telerik Assemblies Using NuGet
To use RadFontDropDownList
when working with NuGet packages, install the Telerik.UI.for.WinForms.AllControls
package. The package target framework version may vary.
Read more about NuGet installation in the Install using NuGet Packages article.
With the 2025 Q1 release, the Telerik UI for WinForms has a new licensing mechanism. You can learn more about it here.
Adding Assembly References Manually
When dragging and dropping a control from the Visual Studio (VS) Toolbox onto the Form Designer, VS automatically adds the necessary assemblies. However, if you're adding the control programmatically, you'll need to manually reference the following assemblies:
- Telerik.Licensing.Runtime
- Telerik.WinControls
- Telerik.WinControls.UI
- TelerikCommon
The Telerik UI for WinForms assemblies can be install by using one of the available installation approaches.
Defining the RadFontDropDownList
The following tutorial demonstrates how to add a RadFontDropDownList and how to retrieve the selected font.
- Add a RadFontDropDownList and a RadLabel to a form.
-
Set some text to the RadLabel via the Properties section in Visual Studio.
-
Set the DropDownStyle property for the RadFontPopupEditorElement via the Element hierrachy editor:
Subscribe to the SelectedFontChanged event and use the following code snippet:
private void radFontDropDownList1_SelectedFontChanged(object sender, EventArgs e)
{
FontFamily ff = new FontFamily(this.radFontDropDownList1.SelectedFont);
if (ff.IsStyleAvailable(FontStyle.Regular))
{
Font font = new Font(ff.Name, 10, FontStyle.Regular);
this.radLabel1.Font = font;
}
else
{
foreach (FontStyle style in Enum.GetValues(typeof(FontStyle)))
{
if (ff.IsStyleAvailable(style))
{
Font font = new Font(ff.Name, 10, style);
this.radLabel1.Font = font;
break;
}
}
}
}
Private Sub radFontDropDownList1_SelectedFontChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim ff As FontFamily = New FontFamily(Me.RadFontDropDownList1.SelectedFont)
If ff.IsStyleAvailable(FontStyle.Regular) Then
Dim font As Font = New Font(ff.Name, 10, FontStyle.Regular)
Me.radLabel1.Font = font
Else
For Each style As FontStyle In [Enum].GetValues(GetType(FontStyle))
If ff.IsStyleAvailable(style) Then
Dim font As Font = New Font(ff.Name, 10, style)
Me.radLabel1.Font = font
Exit For
End If
Next
End If
End Sub
This is it! Now, the change in the selection of the RadFontDropDownList instance will be reflected on RadLabel's font.
Telerik UI for WinForms Learning Resources
- Telerik UI for WinForms FontDropDownList Component
- Getting Started with Telerik UI for WinForms Components
- Telerik UI for WinForms Setup
- Telerik UI for WinForms Application Modernization
- Telerik UI for WinForms Visual Studio Templates
- Deploy Telerik UI for WinForms Applications
- Telerik UI for WinForms Virtual Classroom(Training Courses for Registered Users)
- Telerik UI for WinForms License Agreement)