Block.Margin 屬性

定義

取得或設定 Block 元素周圍的空間量。

public:
 property Thickness Margin { Thickness get(); void set(Thickness value); };
Thickness Margin();

void Margin(Thickness value);
public Thickness Margin { get; set; }
var thickness = block.margin;
block.margin = thickness;
Public Property Margin As Thickness
<Paragraph Margin="uniform"/>
- or -
<Paragraph Margin="left+right,top+bottom"/>
- or -
<Paragraph Margin="left,top,right,bottom"/>
 

屬性值

Block元素周圍的空間量。

備註

程式碼移轉注意事項Microsoft Silverlight 不支援BlockParagraph上的Margin屬性。 Windows Presentation Foundation (WPF) 在 BlockParagraph上有Margin屬性,但也有Windows 執行階段不支援的Padding屬性。 如果您需要每個段落填補支援,您可能需要將每個段落放在不同的 Border 容器中,並使用Panel進行版面配置控制項,並在每個線上設定Border.Padding 或者,使用 RichTextBlock

適用於

另請參閱