xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="FontSizeConverter_Csharp.Window1"
Title="FontSizeConverter Sample">
this is a test
5
8
11
14
17
20
23
26
29
32
Arial
Courier New
Tahoma
Times New Roman
Verdana
//File:Window.xaml.vb
Imports System
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Documents
Imports System.Windows.Navigation
Imports System.Windows.Media
Namespace FontSizeConverter_Csharp
Public Partial Class Window1
Inherits Window
Public Sub changeSize(sender As Object, args As SelectionChangedEventArgs)
Dim li As ListBoxItem = TryCast(TryCast(sender, ListBox).SelectedItem, ListBoxItem)
Dim myFontSizeConverter As New FontSizeConverter()
text1.FontSize = CType(myFontSizeConverter.ConvertFromString(li.Content.ToString()), [Double])
End Sub
Public Sub changeFamily(sender As Object, args As SelectionChangedEventArgs)
Dim li2 As ListBoxItem = TryCast(TryCast(sender, ListBox).SelectedItem, ListBoxItem)
text1.FontFamily = New System.Windows.Media.FontFamily(li2.Content.ToString())
End Sub
End Class
End Namespace