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

  • SEARCH
  • Home
  • 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 3691434
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:08:51+00:00 2026-05-19T04:08:51+00:00

This seems like such a simple question, but I have been trying for an

  • 0

This seems like such a simple question, but I have been trying for an hour and can’t seem to figure it out.

All I want to do is fill the MainWindow with a Canvas. I couldn’t find any properties to allow this, and the only way I could think of to do it is to set Canvas.Width/Height = MainWindow.Width/Height, but I would have to do that every time the window is resized.

In WinForms docking an element in a parent container was easy.

  • 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-05-19T04:08:51+00:00Added an answer on May 19, 2026 at 4:08 am

    Just set the Canvas.HorizontalAlignment and VerticalAlignment to “Stretch”. This will cause the Canvas to fill the space available from it’s containing UI element. Just make sure to NOT specify Width/Height explicitly.

    In XAML, this is just:

    <Window ...Other window props... >
        <Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <!-- Canvas items here... -->
        </Canvas>
    </Window>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems like such a simple question, but I'm having such difficulty with it.
this might sound like a daft question but I can't seem to find a
This question may seem extremely noob-ish, I apologize. I've been periodically attempting for the
Update : It occurred to me after posting this question that the main downside
I have a question about Javascript widgets. The widget I am working on simply
It seems like the elevation of privileges is a common thing most developers fight
I've been writing tests for a while now and I'm starting to get the
It seems as if every Android application I really want to make is impossible
Just a random question. I'm learning a bit of Android right now, and in
I'm about to start a Database Design that will simply manage users under companies.

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.