Hi!
I want to show the exact same content in a listbox and a combobox. Is there an easy way to bind the items collection of the listbox to the items collection to the combobox?
Here is my code:
kind regardsCode:<Window x:Class="BetterTabView.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:b="BetterWpfControls" Title="MainWindow" Height="350" Width="525"> <StackPanel Orientation="Horizontal"> <ListBox x:Name="myListBox" Width="180"> <ListBoxItem>Donald</ListBoxItem> <ListBoxItem>Mickey</ListBoxItem> <ListBoxItem>Daisy</ListBoxItem> <ListBoxItem>Goofy</ListBoxItem> </ListBox> <ComboBox Width="180" Height ="20" x:Name="cmbItems" ItemsSource="{Binding myListBox.Items, Mode=OneWay}" > </ComboBox> </StackPanel> </Window>
Henrik




Reply With Quote