Hallo zusammen,
ich möchte ein dynamisches Grid erstellen.
Kennt sich jemand aus?
und in XAML
Leider bekomme ich den TextBlock nicht angezeigt?
Und wie kann man hier mit Arrays arbeiten?
Dirk
ich möchte ein dynamisches Grid erstellen.
Kennt sich jemand aus?
Quellcode
-
- Dim MatrixTabelle As New Grid()
- MatrixTabelle.Width = 400
- MatrixTabelle.Height = 400
- MatrixTabelle.ShowGridLines = True
- MatrixTabelle.Background = New SolidColorBrush(Colors.Black)
- Dim GridCol As New ColumnDefinition()
- GridCol.Name = "GridCol" & Count.ToString
- MatrixTabelle.ColumnDefinitions.Add(GridCol)
- Dim gridRow As New RowDefinition()
- gridRow.Height = New GridLength(45)
- MatrixTabelle.RowDefinitions.Add(gridRow)
- Dim txtBlock As New TextBlock()
- txtBlock.Text = "Testy"
- txtBlock.FontSize = 14
- txtBlock.FontWeight = FontWeights.Bold
- txtBlock.Foreground = New SolidColorBrush(Colors.Green)
- txtBlock.VerticalAlignment = VerticalAlignment.Top
- Grid.SetRow(txtBlock, 1)
- Grid.SetColumn(txtBlock, 1)
und in XAML
Leider bekomme ich den TextBlock nicht angezeigt?
Und wie kann man hier mit Arrays arbeiten?
Dirk