Class MainWindowクラスの全コード
Imports System.Reflection
Class MainWindow
Dim textblock0 As New TextBlock
Private Sub textbox1_TextChanged(sender As System.Object, e As System.Windows.Controls.TextChangedEventArgs) Handles textbox1.TextChanged
textblock0.Text = textbox1.Text
End Sub
Private Sub slider1_ValueChanged(sender As System.Object, e As System.Windows.RoutedPropertyChangedEventArgs(Of System.Double)) Handles slider1.ValueChanged
textblock0.FontSize = slider1.Value
End Sub
Private Sub textbox2_TextChanged(sender As System.Object, e As System.Windows.Controls.TextChangedEventArgs) Handles textbox2.TextChanged
Dim pinfo As PropertyInfo = GetType(Colors).GetProperty(textbox2.Text)
Dim c As Color
If pinfo Is Nothing Then c = Colors.Red Else c = pinfo.GetValue(Nothing, Nothing)
textblock0.Foreground = New SolidColorBrush(c)
End Sub
Private Sub textblock1_Loaded(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles textblock1.Loaded
textblock0 = textblock1
End Sub
End Class