menu

Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface IInlineContentControl - Xamarin.Forms API Reference | Syncfusion
  • Articles
  • Api Documentation

    Show / Hide Table of Contents

    Interface IInlineContentControl

    Represents a inline content control in the Word document.

    Inherited Members
    IEntity.Clone()
    IEntity.Document
    IEntity.EntityType
    IEntity.IsComposite
    IEntity.NextSibling
    IEntity.Owner
    IEntity.PreviousSibling
    IParagraphItem.IsDeleteRevision
    IParagraphItem.IsInsertRevision
    IParagraphItem.OwnerParagraph
    Namespace: Syncfusion.DocIO.DLS
    Assembly: Syncfusion.DocIO.Portable.dll
    Syntax
    public interface IInlineContentControl : IParagraphItem, IEntity

    Properties

    BreakCharacterFormat

    Gets the character format of the content control. Read-only.

    Declaration
    WCharacterFormat BreakCharacterFormat { get; }
    Property Value
    Type Description
    WCharacterFormat

    The WCharacterFormat object that specifies the character format.

    ContentControlProperties

    Gets the content control properties. Read-only.

    Declaration
    ContentControlProperties ContentControlProperties { get; }
    Property Value
    Type Description
    ContentControlProperties

    The ContentControlProperties object that specifies the content control properties.

    Examples

    The following example illustrates how to set the properties for content control.

         WordDocument document = new WordDocument();
        //Adds new section to the document
        IWSection section = document.AddSection();
        //Adds new paragraph to the section
        IWParagraph paragraph = section.AddParagraph();
        //Adds new rich text content control to the paragraph
        paragraph.AppendInlineContentControl(ContentControlType.RichText);
        //Adds new text to the content control
        WTextRange textRange = new WTextRange(document);
        textRange.Text = "Rich Text Content Control";
        (paragraph.Items.LastItem as IInlineContentControl).ParagraphItems.Add(textRange);
        IInlineContentControl richTextControl = paragraph.Items.LastItem as IInlineContentControl;
        richTextControl.ParagraphItems.Add(textRange);
        // Sets Title property of the content control.
        richTextControl.ContentControlProperties.Title = "Rich text content control";
        //Save the Word document
        document.Save("Sample.docx", FormatType.Docx);
        //Close the document
        document.Close();
       Dim document As New WordDocument()
       'Adds new section to the document
       Dim section As IWSection = document.AddSection()
       'Adds new paragraph to the section
       Dim paragraph As IWParagraph = section.AddParagraph()
       'Adds new rich text content control to the paragraph
       paragraph.AppendInlineContentControl(ContentControlType.RichText)
       'Adds new text to the content control
       Dim textRange As New WTextRange(document)
       textRange.Text = "Rich Text Content Control"
       TryCast(paragraph.Items.LastItem, IInlineContentControl).ParagraphItems.Add(textRange)
       Dim richTextControl As IInlineContentControl = TryCast(paragraph.Items.LastItem, IInlineContentControl)
       richTextControl.ParagraphItems.Add(textRange)
       ' Sets Title property of the content control.
       richTextControl.ContentControlProperties.Title = "Rich text content control"
       'Save the Word document
       document.Save("Sample.docx", FormatType.Docx)
       'Close the document
       document.Close()

    ParagraphItems

    Gets the content control items. Read-only.

    Declaration
    ParagraphItemCollection ParagraphItems { get; }
    Property Value
    Type Description
    ParagraphItemCollection

    The ParagraphItemCollection of the current control.

    Examples

    The following example illustrates how to get the paragraph items of the current inline content control.

        WordDocument document = new WordDocument();
        //Adds new section to the document
        IWSection section = document.AddSection();
        //Adds new paragraph to the section
        IWParagraph paragraph = section.AddParagraph();
        //Adds new rich text content control to the paragraph
        paragraph.AppendInlineContentControl(ContentControlType.RichText);
        //Adds new text to the content control
        WTextRange textRange = new WTextRange(document);
        textRange.Text = "Rich Text Content Control";
        (paragraph.Items.LastItem as IInlineContentControl).ParagraphItems.Add(textRange);
        IInlineContentControl richTextControl = paragraph.Items.LastItem as IInlineContentControl;
        richTextControl.ParagraphItems.Add(textRange);
        // Sets Title property of the content control.
        richTextControl.ContentControlProperties.Title = "Rich text content control";
        //Save the Word document
        document.Save("Sample.docx", FormatType.Docx);
        //Close the document
        document.Close();
       Dim document As New WordDocument()
       'Adds new section to the document
       Dim section As IWSection = document.AddSection()
       'Adds new paragraph to the section
       Dim paragraph As IWParagraph = section.AddParagraph()
       'Adds new rich text content control to the paragraph
       paragraph.AppendInlineContentControl(ContentControlType.RichText)
       'Adds new text to the content control
       Dim textRange As New WTextRange(document)
       textRange.Text = "Rich Text Content Control"
       TryCast(paragraph.Items.LastItem, IInlineContentControl).ParagraphItems.Add(textRange)
       Dim richTextControl As IInlineContentControl = TryCast(paragraph.Items.LastItem, IInlineContentControl)
       richTextControl.ParagraphItems.Add(textRange)
       ' Sets Title property of the content control.
       richTextControl.ContentControlProperties.Title = "Rich text content control"
       'Save the Word document
       document.Save("Sample.docx", FormatType.Docx)
       'Close the document
       document.Close()
    In This Article
    • Properties
      • BreakCharacterFormat
      • ContentControlProperties
      • ParagraphItems
    Was this page helpful? Yes No
    Thank you for your feedback!
    Thank you for your feedback and comments. We will rectify this as soon as possible!
    An unknown error has occurred. Please try again.
    SEND FEEDBACK REGARDING THIS TOPIC

    Please provide additional information

    Please provide additional information

    Please provide additional information

    Please provide additional information
    Please provide additional information
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved