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 8502845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:35:53+00:00 2026-06-11T01:35:53+00:00

I have a canvas placed into a grid. And the grid is placed into

  • 0

I have a canvas placed into a grid. And the grid is placed into a border. When I draw some item (a white line for instance) on the canvas, this item lays over the border, so the border is erasing. Does anybody know how I can avoid it? I tried to set margin to the canvas, larger border’s size than the canvas’s one, but nothing helps.

This is my xaml:

<Border BorderThickness="1"  BorderBrush="#333333" Opacity="1" Name="inner_canvas_border">
    <Grid Name="grid1">
        <Canvas Name="Canvas1"HorizontalAlignment="Center" VerticalAlignment="Center" Width="700" Height="450" />
    </Grid>
</Border>
  • 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. Editorial Team
    Editorial Team
    2026-06-11T01:35:55+00:00Added an answer on June 11, 2026 at 1:35 am

    The default value of the ClipToBounds property on the Canvas is false. Set this to true, and that will prevent elements that are outside of the bounds of the Canvas from displaying outside the bounds of the Canvas:

    <Border
      BorderThickness="1"
      BorderBrush="#333333"
      Opacity="1"
      Name="inner_canvas_border">
      <Grid
        Name="grid1">
        <Canvas
          Name="Canvas1"
          HorizontalAlignment="Center"
          VerticalAlignment="Center"
          Width="700"
          Height="450"
          ClipToBounds="True" /><!-- This line here -->
      </Grid>
    </Border>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a lot of UI elements placed inside a canvas. Some of them
I have a canvas element positioned absolutely over a Flash object of the same
I have this canvas mousedown event: $('#canvas').mousedown(function(e) { var coords = canvas.getMousePos(e); // user
I have a JFrame, in this JFrame I have a JPanel that I draw
I want to have a canvas in xaml where i place some icons. These
In my Windows phone7 application I placed a canvas and have set its background
I am trying to draw a shape on an HTML5 canvas but have the
I want to have a canvas with a border and a rounded corner in
I'm working on an iframe-based canvas application and have run into a major roadblock
Back story: I have an SVG canvas with some polylines on it. I also

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.