xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ThicknessConverter_Csharp.Window1"
Title="ThicknessConverter Sample">
ThicknessConverter Sample
Change the BorderThickness Property:
0
5
10
15
20
25
30
35
40
45
50
//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 ThicknessConverter_Csharp
Public Partial Class Window1
Inherits Window
Public Sub changeThickness(sender As Object, args As SelectionChangedEventArgs)
Dim li As ListBoxItem = TryCast(TryCast(sender, ListBox).SelectedItem, ListBoxItem)
Dim myThicknessConverter As New ThicknessConverter()
Dim th1 As Thickness = CType(myThicknessConverter.ConvertFromString(li.Content.ToString()), Thickness)
border1.BorderThickness = th1
bThickness.Text = "Border.BorderThickness =" & li.Content.ToString()
End Sub
End Class
End Namespace