asked on
Private Sub btnAddItem_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles btnAddSplit.Click
...
Dim ListBoxItemName As New TextBlock
ListBoxItemName.Text = Name.Text
ListBoxItemName.Width = 170
Dim ListBoxItemValue As New TextBlock
ListBoxItemValue.Text = SplitValue.Text
ListBoxItemValue.Width = 70
Dim ListBoxStackPanel As New StackPanel
ListBoxStackPanel.Orientation = Orientation.Horizontal
ListBoxStackPanel.Children.Add(ListBoxItemName)
ListBoxStackPanel.Children.Add(ListBoxItemValue)
Dim NewEntry As New ListBoxItem
NewEntry.Content = ListBoxStackPanel
MyListBox.Items.Add(NewEntry)
...
End Sub