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容器中,並使用面板進行版面配置控制項,並在每個 Border 上設定Border.Padding 或者,使用 RichTextBlock

適用於

另請參閱