Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 81481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:28:00+00:00 2026-05-10T21:28:00+00:00

I have a border element with rounded corners containing a 3×3 grid. The corners

  • 0

I have a border element with rounded corners containing a 3×3 grid. The corners of the grid are sticking out of the border. How can I fix that? I tried using ClipToBounds but didn’t get anywhere. Thanks for your help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:28:01+00:00Added an answer on May 10, 2026 at 9:28 pm

    Here are the highlights of this thread mentioned by Jobi

    • None of the decorators (i.e. Border) or layout panels (i.e. Stackpanel) come with this behavior out-of-the-box.
    • ClipToBounds is for layout. ClipToBounds does not prevent an element from drawing outside its bounds; it just prevents children’s layouts from ‘spilling’. Additionally ClipToBounds=True is not needed for most elements because their implementations dont allow their content’s layout to spill anyway. The most notable exception is Canvas.
    • Finally Border considers the rounded corners to be drawings inside the bounds of its layout.

    Here is an implementation of a class that inherits from Border and implements the proper functionality:

         /// <Remarks>     ///     As a side effect ClippingBorder will surpress any databinding or animation of      ///         its childs UIElement.Clip property until the child is removed from ClippingBorder     /// </Remarks>     public class ClippingBorder : Border {         protected override void OnRender(DrawingContext dc) {             OnApplyChildClip();                         base.OnRender(dc);         }          public override UIElement Child          {             get             {                 return base.Child;             }             set             {                 if (this.Child != value)                 {                     if(this.Child != null)                     {                         // Restore original clipping                         this.Child.SetValue(UIElement.ClipProperty, _oldClip);                     }                      if(value != null)                     {                         _oldClip = value.ReadLocalValue(UIElement.ClipProperty);                     }                     else                      {                         // If we dont set it to null we could leak a Geometry object                         _oldClip = null;                     }                      base.Child = value;                 }             }         }          protected virtual void OnApplyChildClip()         {             UIElement child = this.Child;             if(child != null)             {                 _clipRect.RadiusX = _clipRect.RadiusY = Math.Max(0.0, this.CornerRadius.TopLeft - (this.BorderThickness.Left * 0.5));                 _clipRect.Rect = new Rect(Child.RenderSize);                 child.Clip = _clipRect;             }         }          private RectangleGeometry _clipRect = new RectangleGeometry();         private object _oldClip;     } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 90k
  • Answers 90k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try this rule: RewriteRule ^profile/([^/]+)$ profile.php?user_name=$1 This will rewrite requests… May 11, 2026 at 6:09 pm
  • Editorial Team
    Editorial Team added an answer The .encode method gets applied to a Unicode string to… May 11, 2026 at 6:09 pm
  • Editorial Team
    Editorial Team added an answer CoGetClassObject essentially returns you a pointer to a factory for… May 11, 2026 at 6:09 pm

Related Questions

I have a border element with rounded corners containing a 3x3 grid. The corners
I'm making my first foray into WPF - I have a simple form with
I'm currently using a combination of CSS and Div tags to achieve rounded corners
I have a situation where I am using wpf data binding and validation using
I have a list of categories on a page, each with a nested list

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.