Rich Text Editor / Document Model / Blocks / Block Appearance
In This Topic
    Block Appearance
    In This Topic

    Each block element as well as table columns support the BackgroundFill, Border and BorderThickness properties that control the appearance of the block or column. The following code snippet shows how to create a paragraph with gradient filling and an edged border:

    Setting Block Appearance
    Copy Code
    NParagraph paragraph = new NParagraph();
    
    NTextInline textInline = new NTextInline("Paragraph with solid border and gradient filling applied on the background.");
    textInline.Fill = new NColorFill(NColor.Aquamarine);
    textInline.FontSize = 24;
    paragraph.Inlines.Add(textInline);
    
    paragraph.BackgroundFill = new NStockGradientFill(ENGradientStyle.FromCorner, ENGradientVariant.Variant1, NColor.Gainsboro, NColor.SlateGray);
    paragraph.Border = NBorder.CreateFilledBorder(NColor.DarkBlue);
    paragraph.BorderThickness = new NMargins(3);
    
    paragraph.PreferredWidth = new NMultiLength(ENMultiLengthUnit.Dip, 500);
    

     The code above produces the following paragraph image:

    See Also