WPF VB.Net Tutorial

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="SimpleStack" Height="223" Width="354" MinWidth="50">
  
    
      A Button Stack
    
    Button 1
    Button 2
    Button 3
    Button 4
         Checked="chkVertical_Checked" Unchecked="chkVertical_Unchecked">
      Use Vertical Orientation            
  

//File:Window.xaml.vb
Imports System
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Shapes
Namespace LayoutPanels
  Public Partial Class SimpleStack
    Inherits Window
    Public Sub New()
      InitializeComponent()
    End Sub
    Private Sub chkVertical_Checked(sender As Object, e As RoutedEventArgs)
      stackPanel1.Orientation = Orientation.Horizontal
    End Sub
    Private Sub chkVertical_Unchecked(sender As Object, e As RoutedEventArgs)
      stackPanel1.Orientation = Orientation.Vertical
    End Sub
  End Class
End Namespace