Click here to Skip to main content
15,918,193 members
Home / Discussions / WPF
   

WPF

 
QuestionClipping To Rounded Corners Pin
#realJSOP13-Apr-09 5:27
professional#realJSOP13-Apr-09 5:27 
I have the following code

<Border Margin="3,4,0,0" Height="205" VerticalAlignment="Top" BorderBrush="Black"
             BorderThickness="2" HorizontalAlignment="Left" Width="891" CornerRadius="8,8,8,8">
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
        <StackPanel.Clip>
            <RectangleGeometry Rect="0,0,891,205" RadiusX="8" RadiusY="8"></RectangleGeometry>
        </StackPanel.Clip>
        <Label Height="26" Name="label1" Width="205" HorizontalAlignment="Left" VerticalAlignment="Top"
                 HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontFamily="Arial" FontSize="14"
                 FontStyle="Italic" FontWeight="Bold" Content="Contacts" Background="Black" Foreground="LightSteelBlue"
                 ClipToBounds="True">
            <Label.LayoutTransform>
                <RotateTransform Angle="270" />
            </Label.LayoutTransform>
        </Label>
        <telerik:RadGridView  Name="gridviewContacts" AllowDrop="False" Height="203" VerticalAlignment="Top"
                 Margin="0,0,0,0" AutoGenerateColumns="False" FontFamily="Arial" ClipToBounds="False"
                 Width="863">
            <telerik:Theming.Theme>
                <telerik:VistaTheme />
            </telerik:Theming.Theme>
        </telerik:RadGridView>
    </StackPanel>
</Border>


Essentially, I have a Border that contains a horizontally oriented StackPanel that contains a Label and a Telerik RadGridView. I want to put rounded corners on the Border element, and clip all of the other elements within the Border to not render outside the rounded corners.

The code above contains my latest non-working attempt. I tried to use the ClipToBounds property, but that doesn't seem to do anything.


"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


AnswerRe: Clipping To Rounded Corners [modified] Pin
Eslam Afifi13-Apr-09 7:42
Eslam Afifi13-Apr-09 7:42 
AnswerRe: Clipping To Rounded Corners Pin
Mark Salsbery13-Apr-09 9:45
Mark Salsbery13-Apr-09 9:45 
AnswerRe: Clipping To Rounded Corners Pin
sivaddrahcir20-Apr-09 8:31
sivaddrahcir20-Apr-09 8:31 
QuestionOnRenderComplete like event for WPF controls Pin
Pankaj Chamria13-Apr-09 1:38
Pankaj Chamria13-Apr-09 1:38 
QuestionContext menu in Datatemplate Pin
mikla52111-Apr-09 5:39
mikla52111-Apr-09 5:39 
QuestionRe: Context menu in Datatemplate Pin
Mark Salsbery11-Apr-09 7:42
Mark Salsbery11-Apr-09 7:42 
AnswerRe: Context menu in Datatemplate [modified] Pin
mikla52111-Apr-09 19:54
mikla52111-Apr-09 19:54 
QuestionRe: Context menu in Datatemplate Pin
Mark Salsbery13-Apr-09 8:47
Mark Salsbery13-Apr-09 8:47 
AnswerRe: Context menu in Datatemplate Pin
mikla52113-Apr-09 21:11
mikla52113-Apr-09 21:11 
GeneralRe: Context menu in Datatemplate Pin
Mark Salsbery14-Apr-09 7:00
Mark Salsbery14-Apr-09 7:00 
GeneralRe: Context menu in Datatemplate Pin
mikla52114-Apr-09 20:11
mikla52114-Apr-09 20:11 
GeneralRe: Context menu in Datatemplate Pin
Mark Salsbery14-Apr-09 20:23
Mark Salsbery14-Apr-09 20:23 
QuestionInheritence in XAML Pin
0x3c010-Apr-09 9:09
0x3c010-Apr-09 9:09 
AnswerRe: Inheritence in XAML Pin
0x3c010-Apr-09 9:24
0x3c010-Apr-09 9:24 
QuestionStyles - Where Do I Put them? Pin
#realJSOP10-Apr-09 8:57
professional#realJSOP10-Apr-09 8:57 
AnswerRe: Styles - Where Do I Put them? Pin
R2B210-Apr-09 9:15
R2B210-Apr-09 9:15 
GeneralRe: Styles - Where Do I Put them? Pin
#realJSOP10-Apr-09 10:21
professional#realJSOP10-Apr-09 10:21 
GeneralRe: Styles - Where Do I Put them? Pin
R2B210-Apr-09 10:59
R2B210-Apr-09 10:59 
AnswerRe: Styles - Where Do I Put them? Pin
Mark Salsbery10-Apr-09 9:31
Mark Salsbery10-Apr-09 9:31 
GeneralRe: Styles - Where Do I Put them? Pin
#realJSOP10-Apr-09 10:22
professional#realJSOP10-Apr-09 10:22 
AnswerRe: Styles - Where Do I Put them? Pin
Wes Aday10-Apr-09 19:42
professionalWes Aday10-Apr-09 19:42 
AnswerRe: Styles - Where Do I Put them? Pin
ctnightmare13-Apr-09 9:56
ctnightmare13-Apr-09 9:56 
AnswerRe: Styles - Where Do I Put them? Pin
Jammer14-Apr-09 8:09
Jammer14-Apr-09 8:09 
QuestionWPF Expander Control - Custom Header Pin
#realJSOP10-Apr-09 3:16
professional#realJSOP10-Apr-09 3:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.