PDA

View Full Version : wpf listbox problem


pat3d
04-16-2008, 07:31 PM
Hi,

I have created a listbox with items in XAML file using VS2008. (for a WPF Browser application)
I'm selecting a item with the mouse, and when I'm using the up and down keys of the keyboard and reach the top or the bottom of the listbox, it goes out the listbox.

Is there a way not to leave the listbox ?

I hope I'm clear enough in my explanation.

If anyone can help.

Thanks in advance,


My code:

<Page xmlns:my="clr-namespace:System.Windows.Shapes;assembly=Presentat ionFramework" x:Class="WpfBrowserStyleTest.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dropShadow="clr-namespace:Microsoft.Windows.Themes;assembly=Presen tationFramework.Aero"
Title="Page1" Width="562" ShowsNavigationUI="False">
<Grid Height="263" Width="488">
<Grid.RowDefinitions>
<RowDefinition Height="176.346*" />
<RowDefinition Height="86.654*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="325.422*" />
<ColumnDefinition Width="162.578*" />
</Grid.ColumnDefinitions>
<dropShadow:SystemDropShadowChrome Color="#71000000" Margin="0,0,0,79.083" HorizontalAlignment="Left" Width="159.984">
<ListBox SelectionMode="Multiple" IsTabStop="False">
<ListBoxItem>test</ListBoxItem>
<ListBoxItem>test2</ListBoxItem>
<ListBoxItem>test3</ListBoxItem>
<ListBoxItem>test4</ListBoxItem>
<ListBoxItem>test</ListBoxItem>
<ListBoxItem>test2</ListBoxItem>
<ListBoxItem>test3</ListBoxItem>
<ListBoxItem>test4</ListBoxItem>
</ListBox>
</dropShadow:SystemDropShadowChrome>
<Button Grid.Column="1" Height="23" Margin="40.905,50.245,46.359,0" Name="button1" VerticalAlignment="Top">Button</Button>
</Grid>
</Page>