Grid Column and Row Collections
//File:Window.xaml.vb
Imports System
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Documents
Namespace columndefinitions_grid
Public Partial Class Window1
Inherits Window
Private rowDef1 As RowDefinition
Private colDef1 As ColumnDefinition
Private Sub rem5Row(sender As Object, e As RoutedEventArgs)
If grid1.RowDefinitions.Count < 5 Then
Console.WriteLine("less than 5!")
Else
grid1.RowDefinitions.RemoveRange(0, 5)
End If
End Sub
End Class
End Namespace