Pls someone help me out ! I set a WrapPanel in a ScrollViewer. There are some buttons inside. With the ScrollViewer.CanContentScroll set to true, the buttons are not scrolling up/down by item one by one. The scroll style is still by pixel. But if its a StackPanel instead of the WrapPanel, its ok. The problem is that i really need a WrapPanel. Is it impossible to afford it? Tkx Pedro <ScrollViewer CanContentScroll="True"> <WrapPanel Name="wrapPanel" ScrollViewer.CanContentScroll="True"> <Button>Button1</Button> <Button>Button1</Button> <Button>Button1</Button> <Button>Button1</Button> <Button>Button1</Button> <Button>Button1</Button> <Button>Button1</Button> <Button>Button1</Button> <Button>Button1</Button> <Button>Button1</Button> <Button>Button1</Button> <Button>Button1</Button> <Button>Button1</Button> <Button>Button1</Button>
peterotoole
Posts
-
Scrolling buttons in WrapPanel one by one -
DockPanel LIFO scrollableHi there. I have a stack of buttons in a dockpanel because i need that the last button to get the stack to stay on the top (like LIFO). That's why DockPanel.Dock="Bottom" and LastChildFill="False". The goal is the first button (Button1) is on bottom and the last (Button5) stays on top. Like this code: <!-- <DockPanel LastChildFill="False"> <Button Name="button1" DockPanel.Dock="Bottom">Button1</Button> <Button Name="button2" DockPanel.Dock="Bottom">Button2</Button> <Button Name="button16"DockPanel.Dock="Bottom">Button3</Button> <Button Name="button3" DockPanel.Dock="Bottom">Button4</Button> <Button Name="button4" DockPanel.Dock="Bottom">Button5</Button> </DockPanel> --> My problem starts when dynamically i insert one more button and the space available on the dockpanel is not big enough. The last button disapears (and i have no more space to get the dockpanel bigger). The problem is solved when i put a ScrollViewer and a ItemsControl. Like this: <DockPanel LastChildFill="False"> <ScrollViewer> <ItemsControl> <Button Name="button1" DockPanel.Dock="Bottom">Button1</Button> <Button Name="button2" DockPanel.Dock="Bottom">Button2</Button> <Button Name="button16"DockPanel.Dock="Bottom">Button3</Button> <Button Name="button3" DockPanel.Dock="Bottom">Button4</Button> <Button Name="button4" DockPanel.Dock="Bottom">Button5</Button> </ItemsControl> &nb
-
WPF listbox scroolbar widthHi, Anybody knows how can i control the scroolbar width in a WPF listbox? Tanks for your help!