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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:03:42+00:00 2026-05-23T17:03:42+00:00

When you see Margin attribute in a XAML file of WPF, it has four

  • 0

When you see Margin attribute in a XAML file of WPF, it has four components. Why is this? The first two components make sense they are offset from top left window, but what is it for the third and fourth components when we have Width and Height?

<Grid>
        <Button Content="Button" Height="27" HorizontalAlignment="Left" Margin="29,27,0,0" Name="clickButton" VerticalAlignment="Top" Width="86" Click="clickButton_Click" />
        <TextBox Height="27" HorizontalAlignment="Left" Margin="29,90,0,0" Name="textBoxOut" VerticalAlignment="Top" Width="276" />
</Grid>
  • 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-23T17:03:43+00:00Added an answer on May 23, 2026 at 5:03 pm

    Margin always has four components: left, top, right and bottom. Two components are just shorthand when top=bottom and left=right. And one component is shorthand when all four components are the same.

    Here is good explanation of Margins and Paddings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sometimes you see the margin or padding property set like this div { padding:
See here: http://code.google.com/p/ie7-js/ Does anyone have any experience or remarks about this javascript? Is
This is how my problem looks like: As you can see, there are 3
I'm not able to format my code in IntelliJ. I can see the margin
I am trying to do this... <Image x:Name=imgGroupImage Source=Images\unlock.png Margin=0,0,5,0 /> But I get
I am trying to change the value of the onclick attribute: <span onclick=addPropertyToQuery(this) tagId=${property.id}
my margin value is getting set to zero here and i don't see why.
See this code example: http://jsfiddle.net/Z2BMK/ Chrome/IE8 look like this Firefox looks like this My
See the bullets on this blog post: http://www.nielsbrinch.com/managing-expectation-management/ I have had to change to
See this page at > www.tvdiever.nl HTML: <div id=slogan> <h1 id=site-name><span></span><txp:site_name /></h1> <p id=site-slogan><span></span><txp:site_slogan

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.