menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface IGroupShapes - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Interface IGroupShapes

    Represents a collection of IGroupShape instance in a slide.

    Inherited Members
    System.Collections.Generic.IEnumerable<Syncfusion.Presentation.IGroupShape>.GetEnumerator()
    Namespace: Syncfusion.Presentation
    Assembly: Syncfusion.Presentation.Base.dll
    Syntax
    public interface IGroupShapes : IEnumerable<IGroupShape>, IEnumerable

    Properties

    Count

    Gets the number of elements in the group shape collection. Read-only.

    Declaration
    int Count { get; }
    Property Value
    Type Description
    System.Int32

    The count.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a blank slide to the presentation.
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for group shapes
    IGroupShapes groupShapes = slide.GroupShapes;
    //Add group shape to the collection
    IGroupShape groupShape1 = groupShapes.AddGroupShape(12, 12, 250, 250);
    IGroupShape groupShape2 = groupShapes.AddGroupShape(300, 50, 200, 100);
    //Add shape to group shape.
    groupShape1.Shapes.AddShape(AutoShapeType.Rectangle, 12, 12, 40, 30);
    groupShape1.Shapes.AddShape(AutoShapeType.Oval, 47, 50, 60, 120);
    groupShape2.Shapes.AddShape(AutoShapeType.Rectangle, 200, 12, 40, 30);
    groupShape2.Shapes.AddShape(AutoShapeType.Oval, 250, 50, 60, 120);
    //Get the count of group shapes collection
    int count = groupShapes.Count;
    //Save the presentation
    presentation.Save("Sample.pptx");
    //Close the presentation
    presentation.Close();
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a blank slide to the presentation.
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for group shapes
    Dim groupShapes As IGroupShapes = slide.GroupShapes
    'Add group shape to the collection
    Dim groupShape1 As IGroupShape = groupShapes.AddGroupShape(12, 12, 250, 250)
    Dim groupShape2 As IGroupShape = groupShapes.AddGroupShape(300, 50, 200, 100)
    'Add shape to group shape.
    groupShape1.Shapes.AddShape(AutoShapeType.Rectangle, 12, 12, 40, 30)
    groupShape1.Shapes.AddShape(AutoShapeType.Oval, 47, 50, 60, 120)
    groupShape2.Shapes.AddShape(AutoShapeType.Rectangle, 200, 12, 40, 30)
    groupShape2.Shapes.AddShape(AutoShapeType.Oval, 250, 50, 60, 120)
    'Get the count of group shapes collection
    Dim count As Integer = groupShapes.Count
    'Save the presentation
    presentation__1.Save("Sample.pptx")
    'Close the presentation
    presentation__1.Close()

    Item[Int32]

    Gets a IGroupShape instance from the collection. Read-only.

    Declaration
    IGroupShape this[int index] { get; }
    Parameters
    Type Name Description
    System.Int32 index

    Index from the collection.

    Property Value
    Type Description
    IGroupShape

    The IGroupShape.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a blank slide to the presentation.
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for group shapes
    IGroupShapes groupShapes = slide.GroupShapes;
    //Add group shape to the collection
    IGroupShape groupShape1 = groupShapes.AddGroupShape(12, 12, 250, 250);
    IGroupShape groupShape2 = groupShapes.AddGroupShape(300, 50, 200, 100);
    //Add shape to group shape.
    groupShape1.Shapes.AddShape(AutoShapeType.Rectangle, 12, 12, 40, 30);
    groupShape1.Shapes.AddShape(AutoShapeType.Oval, 47, 50, 60, 120);
    groupShape2.Shapes.AddShape(AutoShapeType.Rectangle, 200, 12, 40, 30);
    groupShape2.Shapes.AddShape(AutoShapeType.Oval, 250, 50, 60, 120);
    //To access a specific group shape in the collection
    IGroupShape groupShape = groupShapes[0];
    //Set the description
    groupShape.Description = "First group shape";
    //Save the presentation
    presentation.Save("Sample.pptx");
    //Close the presentation
    presentation.Close();
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a blank slide to the presentation.
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for group shapes
    Dim groupShapes As IGroupShapes = slide.GroupShapes
    'Add group shape to the collection
    Dim groupShape1 As IGroupShape = groupShapes.AddGroupShape(12, 12, 250, 250)
    Dim groupShape2 As IGroupShape = groupShapes.AddGroupShape(300, 50, 200, 100)
    'Add shape to group shape.
    groupShape1.Shapes.AddShape(AutoShapeType.Rectangle, 12, 12, 40, 30)
    groupShape1.Shapes.AddShape(AutoShapeType.Oval, 47, 50, 60, 120)
    groupShape2.Shapes.AddShape(AutoShapeType.Rectangle, 200, 12, 40, 30)
    groupShape2.Shapes.AddShape(AutoShapeType.Oval, 250, 50, 60, 120)
    'To access a specific group shape in the collection
    Dim groupShape As IGroupShape = groupShapes(0)
    'Set the description
    groupShape.Description = "First group shape"
    'Save the presentation
    presentation__1.Save("Sample.pptx")
    'Close the presentation
    presentation__1.Close()

    Methods

    AddGroupShape(Double, Double, Double, Double)

    Creates a group shape and adds the group shape to the shape collection.

    Declaration
    IGroupShape AddGroupShape(double left, double top, double width, double height)
    Parameters
    Type Name Description
    System.Double left

    Represents the left position, in points. The Left value ranges from -169056 to 169056.

    System.Double top

    Represents the top position, in points. The Top value ranges from -169056 to 169056.

    System.Double width

    Represents the width, in points. The Width value ranges from 0 to 169056.

    System.Double height

    Represents the height, in points. The Height value ranges from 0 to 169056.

    Returns
    Type Description
    IGroupShape

    Returns an IGroupShape instance this method creates.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a blank slide to the presentation.
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for group shapes
    IGroupShapes groupShapes = slide.GroupShapes;
    //Add group shape to the collection
    IGroupShape groupShape = groupShapes.AddGroupShape(12, 12, 300, 350);
    //Add shapes to group shape.
    groupShape.Shapes.AddShape(AutoShapeType.Rectangle, 12, 12, 40, 30);
    groupShape.Shapes.AddShape(AutoShapeType.Oval, 47, 50, 60, 120);
    //Save the presentation
    presentation.Save("Sample.pptx");
    //Close the presentation
    presentation.Close();
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a blank slide to the presentation.
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for group shapes
    Dim groupShapes As IGroupShapes = slide.GroupShapes
    'Add group shape to the collection
    Dim groupShape As IGroupShape = groupShapes.AddGroupShape(12, 12, 300, 350)
    'Add shapes to group shape.
    groupShape.Shapes.AddShape(AutoShapeType.Rectangle, 12, 12, 40, 30)
    groupShape.Shapes.AddShape(AutoShapeType.Oval, 47, 50, 60, 120)
    'Save the presentation
    presentation__1.Save("Sample.pptx")
    'Close the presentation
    presentation__1.Close()

    IndexOf(IGroupShape)

    Returns the zero-based index of the first occurrence of the IGroupShape instance within the collection.

    Declaration
    int IndexOf(IGroupShape groupShape)
    Parameters
    Type Name Description
    IGroupShape groupShape

    The IGroupShape instance to locate in the collection.

    Returns
    Type Description
    System.Int32

    Returns the zero-based index of the first occurrence of the specified group shape within the collection, if found; otherwise, –1.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a blank slide to the presentation.
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for group shapes
    IGroupShapes groupShapes = slide.GroupShapes;
    //Add group shape to the collection
    IGroupShape groupShape1 = groupShapes.AddGroupShape(12, 12, 250, 250);
    IGroupShape groupShape2 = groupShapes.AddGroupShape(300, 50, 200, 100);
    //Add shape to group shape.
    groupShape1.Shapes.AddShape(AutoShapeType.Rectangle, 12, 12, 40, 30);
    groupShape1.Shapes.AddShape(AutoShapeType.Oval, 47, 50, 60, 120);
    groupShape2.Shapes.AddShape(AutoShapeType.Rectangle, 200, 12, 40, 30);
    groupShape2.Shapes.AddShape(AutoShapeType.Oval, 250, 50, 60, 120);
    //Get the index of added group shape
    int index = groupShapes.IndexOf(groupShape1);
    //Save the presentation
    presentation.Save("Sample.pptx");
    //Close the presentation
    presentation.Close();
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a blank slide to the presentation.
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for group shapes
    Dim groupShapes As IGroupShapes = slide.GroupShapes
    'Add group shape to the collection
    Dim groupShape1 As IGroupShape = groupShapes.AddGroupShape(12, 12, 250, 250)
    Dim groupShape2 As IGroupShape = groupShapes.AddGroupShape(300, 50, 200, 100)
    'Add shape to group shape.
    groupShape1.Shapes.AddShape(AutoShapeType.Rectangle, 12, 12, 40, 30)
    groupShape1.Shapes.AddShape(AutoShapeType.Oval, 47, 50, 60, 120)
    groupShape2.Shapes.AddShape(AutoShapeType.Rectangle, 200, 12, 40, 30)
    groupShape2.Shapes.AddShape(AutoShapeType.Oval, 250, 50, 60, 120)
    'Get the index of added group shape
    Dim index As Integer = groupShapes.IndexOf(groupShape1)
    'Save the presentation
    presentation__1.Save("Sample.pptx")
    'Close the presentation
    presentation__1.Close()

    Remove(IGroupShape)

    Removes the first occurrence of a specified IGroupShape instance from the group shape collection.

    Declaration
    void Remove(IGroupShape groupShape)
    Parameters
    Type Name Description
    IGroupShape groupShape

    The group shape object to be removed from the collection.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a blank slide to the presentation.
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for group shapes
    IGroupShapes groupShapes = slide.GroupShapes;
    //Add group shape to the collection
    IGroupShape groupShape1 = groupShapes.AddGroupShape(12, 12, 250, 250);
    IGroupShape groupShape2 = groupShapes.AddGroupShape(300, 50, 200, 100);
    //Add shape to group shape.
    groupShape1.Shapes.AddShape(AutoShapeType.Rectangle, 12, 12, 40, 30);
    groupShape1.Shapes.AddShape(AutoShapeType.Oval, 47, 50, 60, 120);
    groupShape2.Shapes.AddShape(AutoShapeType.Rectangle, 200, 12, 40, 30);
    groupShape2.Shapes.AddShape(AutoShapeType.Oval, 250, 50, 60, 120);
    //Remove a group shape instance from collection
    groupShapes.Remove(groupShape2);
    //Save the presentation
    presentation.Save("Sample.pptx");
    //Close the presentation
    presentation.Close();
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a blank slide to the presentation.
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for group shapes
    Dim groupShapes As IGroupShapes = slide.GroupShapes
    'Add group shape to the collection
    Dim groupShape1 As IGroupShape = groupShapes.AddGroupShape(12, 12, 250, 250)
    Dim groupShape2 As IGroupShape = groupShapes.AddGroupShape(300, 50, 200, 100)
    'Add shape to group shape.
    groupShape1.Shapes.AddShape(AutoShapeType.Rectangle, 12, 12, 40, 30)
    groupShape1.Shapes.AddShape(AutoShapeType.Oval, 47, 50, 60, 120)
    groupShape2.Shapes.AddShape(AutoShapeType.Rectangle, 200, 12, 40, 30)
    groupShape2.Shapes.AddShape(AutoShapeType.Oval, 250, 50, 60, 120)
    'Remove a group shape instance from collection
    groupShapes.Remove(groupShape2)
    'Save the presentation
    presentation__1.Save("Sample.pptx")
    'Close the presentation
    presentation__1.Close()

    RemoveAt(Int32)

    Removes the element at the specified index of the group shape collection.

    Declaration
    void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the group shape object to be removed.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a blank slide to the presentation.
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for group shapes
    IGroupShapes groupShapes = slide.GroupShapes;
    //Add group shape to the collection
    IGroupShape groupShape1 = groupShapes.AddGroupShape(12, 12, 250, 250);
    IGroupShape groupShape2 = groupShapes.AddGroupShape(300, 50, 200, 100);
    //Add shape to group shape.
    groupShape1.Shapes.AddShape(AutoShapeType.Rectangle, 12, 12, 40, 30);
    groupShape1.Shapes.AddShape(AutoShapeType.Oval, 47, 50, 60, 120);
    groupShape2.Shapes.AddShape(AutoShapeType.Rectangle, 200, 12, 40, 30);
    groupShape2.Shapes.AddShape(AutoShapeType.Oval, 250, 50, 60, 120);
    //Remove an item from specific index.
    groupShapes.RemoveAt(0);
    //Save the presentation
    presentation.Save("Sample.pptx");
    //Close the presentation
    presentation.Close();
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a blank slide to the presentation.
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for group shapes
    Dim groupShapes As IGroupShapes = slide.GroupShapes
    'Add group shape to the collection
    Dim groupShape1 As IGroupShape = groupShapes.AddGroupShape(12, 12, 250, 250)
    Dim groupShape2 As IGroupShape = groupShapes.AddGroupShape(300, 50, 200, 100)
    'Add shape to group shape.
    groupShape1.Shapes.AddShape(AutoShapeType.Rectangle, 12, 12, 40, 30)
    groupShape1.Shapes.AddShape(AutoShapeType.Oval, 47, 50, 60, 120)
    groupShape2.Shapes.AddShape(AutoShapeType.Rectangle, 200, 12, 40, 30)
    groupShape2.Shapes.AddShape(AutoShapeType.Oval, 250, 50, 60, 120)
    'Remove an item from specific index.
    groupShapes.RemoveAt(0)
    'Save the presentation
    presentation__1.Save("Sample.pptx")
    'Close the presentation
    presentation__1.Close()

    Extension Methods

    PivotExtension.GroupByMany<TElement>(IEnumerable<TElement>, Int32, Func<TElement, Object>[])
    PivotExtension.GroupByMany<TElement>(IEnumerable<TElement>, IEnumerable<Func<TElement, Object>>)
    FunctionalExtensions.ForEach<T>(IEnumerable, Action<T>)
    FunctionalExtensions.ForEach<T>(IEnumerable<T>, Action<T>)
    FunctionalExtensions.ToList<T>(IEnumerable)
    ChartExtensionUtils.DistinctBy<TSource, TKey>(IEnumerable<TSource>, Func<TSource, TKey>)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved