|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
XAML & Element ArrangementsI have a grid. In one of the cells I want to show a list box that has
a lot of entries. The problem is that as soon as I put the list box in a stack panel the list has its full length, i.e. not vertical scroll bar. As a consequence it extends beyond the window. How do I limit the size of the list box so everything fits into the cell/stack panel. <StackPanel Height="Auto" Name="StackPanelFunctions" Grid.Column="0" Grid.Row="0"> <ListBox Height="Auto" Width="Auto" /> <TextBox>My Text Box</TextBox> </StackPanel> Either remove the Height="Auto" and Width="Auto" from ListBox and give them
absolute pixel sizes, or instead of using a StackPanel, try using a DockPanel with LastChildFill set to true: <Grid> <DockPanel LastChildFill="True"> <TextBox DockPanel.Dock="Bottom">My Text Box</TextBox> <ListBox Height="Auto" Width="Auto" /> </DockPanel> </Grid> -- Show quoteHide quoteDeveloper, Microsoft Office "hufaun***@yahoo.com" wrote: > I have a grid. In one of the cells I want to show a list box that has > a lot of entries. The problem is that as soon as I put the list box in > a stack panel the list has its full length, i.e. not vertical scroll > bar. As a consequence it extends beyond the window. How do I limit the > size of the list box so everything fits into the cell/stack panel. > > <StackPanel Height="Auto" Name="StackPanelFunctions" Grid.Column="0" > Grid.Row="0"> > <ListBox Height="Auto" Width="Auto" /> > <TextBox>My Text Box</TextBox> > </StackPanel> > >
Other interesting topics
Managed vs Unmanaged Bare Bones Performance Test
Socket Problem: Exclusive Bind naive question on applicatonrunnig from USB drive Add managed assemblies to GAC programmatically? Name Visability in XAML & Code Behind Printing Question Hooking ObjectDataSource Up to a Shared Generic Method ASP Pgm pls Rectify the problem MethodBuilder.CreateMethodBody Time Setting - HELP!!! |
|||||||||||||||||||||||