RE: Understanding the margin property.



Hi George,

Firstly, when we place an element in a Grid without setting the
HorizontalAlignment and VerticalAlignment property of the element, this
element will be centered in the Grid both horizontally and vertically by
default.

If we set the Margin property of the element, WPF layout subtracts the
specified margin from the Grid's height and width and then centers the
element in the remaining space.

For example, both the width and height of the Grid are 200 and the width
and height of the child rectangle are 100. The Margin property of the
rectangle is set to "0,10,0,0". Then the left-top corner of the rectangle
will be positioned at the point of {50,55} within the Grid.

This should explain your question.

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


.



Relevant Pages

  • Re: Text Box Spell Check
    ... The company I work for uses Component One grid ... careful about how we register the objects. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.vb)
  • Re: dataset/GridView calculation
    ... I'm using this on other values in the grid but their not templateFields ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ... project analysis and dump analysis issues. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: DataGridView Handling ESC
    ... The grid will not allow movement to the new row. ... sees his error in column1 and presses the key. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • ANN: TAdvStringGrid v3.0 released
    ... We're excited to announce the release of the new TAdvStringGrid v3.0 at ... copies grid as HTML on the clipboard ... Support for background display over full background, ... Filter selection to filter on virtual cell text or grid cells text ...
    (borland.public.delphi.thirdpartytools.general)
  • I encounter the same error, but my data does not have the benefit of record tags.
    ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ... where an initial response from the community or a Microsoft Support ... I am having trouble creating one input flat file. ...
    (microsoft.public.biztalk.general)

Loading