Margin
The Margin property describes the distance between an element and its peers in a layout situation, and also the distance between an element and the content area of a container that contains the element. If you think of elements as bounding boxes or rectangles where the dimensions are the ActualHeight and ActualWidth, the Margin layout applies to the outside of that rectangle and does not add pixels to the ActualHeight and ActualWidth. The margin is also not considered part of the element for purposes of hit testing and sourcing input events.
In general layout behavior, components of a Margin value are constrained last, and are constrained only after Heightand Width are already constrained all the way to 0. So, be careful with margins when the container is already clipping or constraining the element; otherwise, your margin could be the cause of an element not appearing to render (because one of its dimensions has been constrained to 0 after the margin was applied).
Margin values can be uniform, by using syntax like Margin="20". With this syntax, a uniform margin of 20 pixels would be applied to the element, with a 20-pixel margin on the left, top, right, and bottom sides. Margin values can also take the form of four distinct values, each value describing a distinct margin to apply to the left, top, right, and bottom (in that order). For example, Margin="0,10,5,25". The underlying type for the Margin property is a Thickness structure, which has properties that hold the Left, Top, Right, and Bottom values as separate Double values.
Margins are additive. For example, if two elements each specify a uniform margin of 10 pixels and they are adjacent peers in any orientation, the distance between the elements is 20 pixels.
Negative margins are permitted. However, using a negative margin can often cause clipping, or overdraws of peers, so it's not a common technique to use negative margins.
Proper use of the Margin property enables very fine control of an element's rendering position and the rendering position of its neighbor elements and children. When you use element dragging to position elements within the XAML designer in Visual Studio, you'll see that the modified XAML typically has values for Margin of that element that were used to serialize your positioning changes back into the XAML.
The Block class, which is a base class for Paragraph, also has a Margin property. It has an analogous effect on how thatParagraph is positioned within its parent container, which is typically a RichTextBlock or RichEditBox object, and also how more than one paragraph is positioned relative to other Block peers from the RichTextBlock.Blocks collection.
ล้านบาทส่วนคุณสมบัติอธิบายถึงระยะห่างระหว่างองค์ประกอบและเพื่อนในรูปแบบสถานการณ์ และระยะห่างระหว่างองค์ประกอบและเนื้อหาของพื้นที่ภาชนะที่ประกอบด้วยธาตุ ถ้าคุณคิดว่าขององค์ประกอบที่เป็นกล่องสี่เหลี่ยมที่วิ่งหรือมิติและเป็น actualheight actualwidth , ขอบเค้าโครงกับด้านนอกของสี่เหลี่ยมผืนผ้าและไม่เพิ่มพิกเซลเพื่อ actualheight และ actualwidth . ขอบยังไม่ถือเป็นส่วนหนึ่งขององค์ประกอบสำหรับวัตถุประสงค์ของการทดสอบและการจัดหากิจกรรมตีใส่พฤติกรรมในรูปแบบทั่วไป องค์ประกอบของอัตราค่าอย่างต่อเนื่อง ล่าสุด , และข้อ จำกัด เฉพาะหลังกว้าง heightand แล้วบังคับเลย 0 ดังนั้น ระวังขอบภาชนะ แล้วเมื่อตัดหรือจำกัดองค์ประกอบ ไม่งั้นขอบของคุณอาจเป็นสาเหตุขององค์ประกอบที่ไม่ปรากฏที่จะให้ ( เพราะหนึ่งในมิติของตนถูกบังคับให้ 0 หลังจากสมัคร )ค่าขอบสามารถเครื่องแบบ โดยใช้ไวยากรณ์เหมือนขอบ = " 20 " กับไวยากรณ์นี้ ขอบชุด 20 พิกเซลจะใช้องค์ประกอบที่มี 20 พิกเซลขอบบนซ้าย , บน , ขวาและด้านล่าง ค่าขอบยังสามารถใช้รูปแบบของ 4 ค่าแต่ละค่าอธิบายขอบชัดเจน ทาซ้าย บน ขวา ล่าง ( เพื่อ ) ตัวอย่างเช่น บริษัท = " 0,10,5,25 " ต้นแบบประเภทหลักประกันทรัพย์สินเป็น โครงสร้างหนา ซึ่งมีสรรพคุณที่ถือซ้าย บนขวา และล่างแยกค่าสองค่าบริษัทเสริม ตัวอย่างเช่นถ้าสององค์ประกอบแต่ละระบุขอบของชุด 10 พิกเซลและพวกเขาจะติดเพื่อน ในทิศทางใด ๆ ระยะทางระหว่างองค์ประกอบ 20 พิกเซลขอบเชิงลบที่ได้รับอนุญาต อย่างไรก็ตาม การใช้ขอบเชิงลบมักจะก่อให้เกิดการตัด หรือ overdraws ของเพื่อนแล้ว มันไม่ได้เป็นเทคนิคทั่วไปในการใช้ระยะขอบที่เป็นลบการใช้ที่เหมาะสมของบริษัทคุณสมบัติช่วยควบคุมที่ดีมากขององค์ประกอบของการแสดงผลตำแหน่งและแสดงตำแหน่งขององค์ประกอบของเพื่อนบ้านและเด็ก เมื่อคุณใช้องค์ประกอบการลากองค์ประกอบตำแหน่งภายใน Designer XAML ใน Visual Studio , คุณจะเห็นว่าการแก้ไข XAML โดยทั่วไปจะมีค่าสำหรับขอบขององค์ประกอบที่ใช้ในการทำให้เป็นอนุกรมตำแหน่งของคุณการเปลี่ยนแปลงกลับมาเป็น XAML .บล็อกชั้น ซึ่งเป็นชั้นฐานสำหรับย่อหน้ายังมีอัตราคุณสมบัติ มันมีผลกระทบที่คล้ายกันในวิธีที่ thatparagraph ตั้งอยู่ภายในภาชนะของผู้ปกครอง ซึ่งเป็นปกติ richtextblock หรือ richeditbox วัตถุและวิธีการมากกว่าหนึ่งย่อหน้า คือ วางเทียบกับอื่น ๆบล็อกเพื่อนจาก richtextblock บล็อกคอลเลกชัน
การแปล กรุณารอสักครู่..
