how do I get a rectangle with rounded edges to contain a textbox and a button ?
-
So, how do I get a rectangle with rounded edges to contain a textbox and a button ? additionally, the rectangle should stretch automatically as the form is resized by the user. this is the XAML so far:
<ScrollViewer Margin="0,23" Name="ScrollViewer1" HorizontalScrollBarVisibility="Auto"> <StackPanel Name="StackPanel1"> <DockPanel Height="100" Width="Auto" Name="DockPanel1" LastChildFill="True"> <TextBox Height="23" DockPanel.Dock="Top" /> <Button Height="23" Name="Button4" Width="75" DockPanel.Dock="Bottom" HorizontalAlignment="Right">Button</Button> <TextBox DockPanel.Dock="Left" /> </DockPanel> <DockPanel Height="100" Width="Auto" Name="DockPanel2" LastChildFill="True"> <TextBox Height="23" DockPanel.Dock="Top" /> <Button Height="23" Name="Button5" Width="75" DockPanel.Dock="Bottom" HorizontalAlignment="Right">Button</Button> <TextBox DockPanel.Dock="Left" /> </DockPanel> </StackPanel> </ScrollViewer>
The scrollviewer fills the window and I'm going to fill it with a load of DockPanel's that contain bits of info and a button. It's resizing great when the user changes the window size, but the DockPanel's should have rounded edges... which I can't work out how to do. -
So, how do I get a rectangle with rounded edges to contain a textbox and a button ? additionally, the rectangle should stretch automatically as the form is resized by the user. this is the XAML so far:
<ScrollViewer Margin="0,23" Name="ScrollViewer1" HorizontalScrollBarVisibility="Auto"> <StackPanel Name="StackPanel1"> <DockPanel Height="100" Width="Auto" Name="DockPanel1" LastChildFill="True"> <TextBox Height="23" DockPanel.Dock="Top" /> <Button Height="23" Name="Button4" Width="75" DockPanel.Dock="Bottom" HorizontalAlignment="Right">Button</Button> <TextBox DockPanel.Dock="Left" /> </DockPanel> <DockPanel Height="100" Width="Auto" Name="DockPanel2" LastChildFill="True"> <TextBox Height="23" DockPanel.Dock="Top" /> <Button Height="23" Name="Button5" Width="75" DockPanel.Dock="Bottom" HorizontalAlignment="Right">Button</Button> <TextBox DockPanel.Dock="Left" /> </DockPanel> </StackPanel> </ScrollViewer>
The scrollviewer fills the window and I'm going to fill it with a load of DockPanel's that contain bits of info and a button. It's resizing great when the user changes the window size, but the DockPanel's should have rounded edges... which I can't work out how to do.Not completely sure if it is what you are looking for, but you can try this...
<ScrollViewer Margin="0,23" Name="ScrollViewer1" HorizontalScrollBarVisibility="Auto">
<StackPanel Name="StackPanel1"><Border CornerRadius="10" Background="#444444">
<DockPanel Height="100" Width="Auto" Name="DockPanel1" LastChildFill="True">
<TextBox Height="23" DockPanel.Dock="Top" Margin="15,15,15,0"/>
<Button Height="23" Name="Button4" Width="75" DockPanel.Dock="Bottom" HorizontalAlignment="Right" Margin="0,0,15,0">Button</Button>
</DockPanel>
</Border>
<Border CornerRadius="10" Background="#444444" Margin="0,10,0,0">
<DockPanel Height="100" Width="Auto" Name="DockPanel2" LastChildFill="True">
<TextBox Height="23" DockPanel.Dock="Top" Margin="15,15,15,0" />
<Button Height="23" Name="Button5" Width="75" DockPanel.Dock="Bottom" HorizontalAlignment="Right" Margin="0,0,15,0">Button</Button>
</DockPanel>
</Border>
</StackPanel>
</ScrollViewer> -
Not completely sure if it is what you are looking for, but you can try this...
<ScrollViewer Margin="0,23" Name="ScrollViewer1" HorizontalScrollBarVisibility="Auto">
<StackPanel Name="StackPanel1"><Border CornerRadius="10" Background="#444444">
<DockPanel Height="100" Width="Auto" Name="DockPanel1" LastChildFill="True">
<TextBox Height="23" DockPanel.Dock="Top" Margin="15,15,15,0"/>
<Button Height="23" Name="Button4" Width="75" DockPanel.Dock="Bottom" HorizontalAlignment="Right" Margin="0,0,15,0">Button</Button>
</DockPanel>
</Border>
<Border CornerRadius="10" Background="#444444" Margin="0,10,0,0">
<DockPanel Height="100" Width="Auto" Name="DockPanel2" LastChildFill="True">
<TextBox Height="23" DockPanel.Dock="Top" Margin="15,15,15,0" />
<Button Height="23" Name="Button5" Width="75" DockPanel.Dock="Bottom" HorizontalAlignment="Right" Margin="0,0,15,0">Button</Button>
</DockPanel>
</Border>
</StackPanel>
</ScrollViewer>