Class GroupShape
Namespace: Aspose.Cells.Drawing
Assembly: Aspose.Cells.dll (25.2.0)
Represents the group shape which contains the individual shapes.
public class GroupShape : Shape
Inheritance
object ← Shape ← GroupShape
Inherited Members
Shape.GetResultOfSmartArt(), Shape.ToFrontOrBack(int), Shape.GetLockedProperty(ShapeLockType), Shape.SetLockedProperty(ShapeLockType, bool), Shape.AddHyperlink(string), Shape.RemoveHyperlink(), Shape.MoveToRange(int, int, int, int), Shape.AlignTopRightCorner(int, int), Shape.GetConnectionPoints(), Shape.ToImage(Stream, ImageType), Shape.ToImage(string, ImageOrPrintOptions), Shape.ToImage(Stream, ImageOrPrintOptions), Shape.GetLinkedCell(bool, bool), Shape.SetLinkedCell(string, bool, bool), Shape.GetInputRange(bool, bool), Shape.SetInputRange(string, bool, bool), Shape.UpdateSelectedValue(), Shape.CalculateTextSize(), Shape.FormatCharacters(int, int, Font, StyleFlag), Shape.Characters(int, int), Shape.GetRichFormattings(), Shape.RemoveActiveXControl(), Shape.IsSameSetting(object), Shape.GetActualBox(), Shape.MacroName, Shape.IsEquation, Shape.IsSmartArt, Shape.ZOrderPosition, Shape.Name, Shape.AlternativeText, Shape.Title, Shape.Line, Shape.Fill, Shape.ShadowEffect, Shape.Reflection, Shape.Glow, Shape.SoftEdges, Shape.ThreeDFormat, Shape.FormatPicture, Shape.IsHidden, Shape.IsAspectRatioLocked, Shape.RotationAngle, Shape.Hyperlink, Shape.Id, Shape.Spid, Shape.Spt, Shape.Worksheet, Shape.IsGroup, Shape.IsInGroup, Shape.IsWordArt, Shape.TextEffect, Shape.IsLocked, Shape.IsPrintable, Shape.MsoDrawingType, Shape.AutoShapeType, Shape.AnchorType, Shape.Placement, Shape.UpperLeftRow, Shape.UpperDeltaY, Shape.UpperLeftColumn, Shape.UpperDeltaX, Shape.LowerRightRow, Shape.LowerDeltaY, Shape.LowerRightColumn, Shape.LowerDeltaX, Shape.Right, Shape.Bottom, Shape.Width, Shape.WidthInch, Shape.WidthPt, Shape.WidthCM, Shape.Height, Shape.HeightInch, Shape.HeightPt, Shape.HeightCM, Shape.Left, Shape.LeftInch, Shape.LeftCM, Shape.Top, Shape.TopInch, Shape.TopCM, Shape.TopToCorner, Shape.LeftToCorner, Shape.X, Shape.Y, Shape.WidthScale, Shape.HeightScale, Shape.TopInShape, Shape.LeftInShape, Shape.WidthInShape, Shape.HeightInShape, Shape.Group, Shape.Type, Shape.HasLine, Shape.IsFilled, Shape.IsFlippedHorizontally, Shape.IsFlippedVertically, Shape.ActualLowerRightRow, Shape.RelativeToOriginalPictureSize, Shape.LinkedCell, Shape.InputRange, Shape.TextShapeType, Shape.TextBody, Shape.Font, Shape.TextOptions, Shape.Text, Shape.IsRichText, Shape.HtmlText, Shape.TextVerticalOverflow, Shape.TextHorizontalOverflow, Shape.IsTextWrapped, Shape.TextOrientationType, Shape.TextHorizontalAlignment, Shape.TextVerticalAlignment, Shape.TextDirection, Shape.TextBoxOptions, Shape.ControlData, Shape.ActiveXControl, Shape.Paths, Shape.Geometry, Shape.CreateId, Shape.IsDecorative, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Examples
csharp
[C#]
//Instantiate a new Workbook.
Workbook excelbook = new Workbook();
//Add a group box to the first worksheet.
GroupBox box = excelbook.Worksheets[0].Shapes.AddGroupBox(1, 0, 1, 0, 300, 250);
//Set the caption of the group box.
box.Text = "Age Groups";
box.Placement = PlacementType.FreeFloating;
//Make it 2-D box.
box.Shadow = false;
//Add a radio button.
RadioButton radio1 = excelbook.Worksheets[0].Shapes.AddRadioButton(3, 0, 2, 0, 30, 110);
//Set its text string.
radio1.Text = "20-29";
//Set A1 cell as a linked cell for the radio button.
radio1.LinkedCell = "A1";
//Make the radio button 3-D.
radio1.Shadow = true;
//Make the line format visible.
radio1.Line.FillType = FillType.Solid;
//Make the fill format visible.
radio1.Fill.FillType = FillType.Solid;
//Set the foreground color of the radio button.
radio1.Fill.SolidFill.Color = Color.LightGreen;
//Set the line style of the radio button.
radio1.Line.CompoundType = MsoLineStyle.ThickThin;
//Set the weight of the radio button.
radio1.Line.Weight = 4;
//Set the line color of the radio button.
radio1.Line.SolidFill.Color = Color.Blue;
//Set the dash style of the radio button.
radio1.Line.DashStyle = MsoLineDashStyle.Solid;
//Add another radio button.
RadioButton radio2 = excelbook.Worksheets[0].Shapes.AddRadioButton(6, 0, 2, 0, 30, 110);
//Set its text string.
radio2.Text = "30-39";
//Set A1 cell as a linked cell for the radio button.
radio2.LinkedCell = "A1";
//Make the radio button 3-D.
radio2.Shadow = true;
//Make the line format visible.
radio2.Line.FillType = FillType.Solid;
//Make the fill format visible.
radio2.Fill.FillType = FillType.Solid;
//Set the foreground color of the radio button.
radio2.Fill.SolidFill.Color = Color.LightGreen;
//Set the line style of the radio button.
radio2.Line.CompoundType = MsoLineStyle.ThickThin;
//Set the weight of the radio button.
radio2.Line.Weight = 4;
//Set the line color of the radio button.
radio2.Line.SolidFill.Color = Color.Blue;
//Set the dash style of the radio button.
radio2.Line.DashStyle = MsoLineDashStyle.Solid;
//Add another radio button.
RadioButton radio3 = excelbook.Worksheets[0].Shapes.AddRadioButton(9, 0, 2, 0, 30, 110);
//Set its text string.
radio3.Text = "40-49";
//Set A1 cell as a linked cell for the radio button.
radio3.LinkedCell = "A1";
//Make the radio button 3-D.
radio3.Shadow = true;
//Make the line format visible.
radio3.Line.FillType = FillType.Solid;
//Make the fill format visible.
radio3.Fill.FillType = FillType.Solid;
//Set the foreground color of the radio button.
radio3.Fill.SolidFill.Color = Color.LightGreen;
//Set the line style of the radio button.
radio3.Line.CompoundType = MsoLineStyle.ThickThin;
//Set the weight of the radio button.
radio3.Line.Weight = 4;
//Set the line color of the radio button.
radio3.Line.SolidFill.Color = Color.Blue;
//Set the dash style of the radio button.
radio3.Line.DashStyle = MsoLineDashStyle.Solid;
//Get the shapes.
Shape[] shapeobjects = new Shape[] { box, radio1, radio2, radio3 };
//Group the shapes.
GroupShape group = excelbook.Worksheets[0].Shapes.Group(shapeobjects);
//Save the excel file.
excelbook.Save("groupshapes.xls");
'Instantiate a new Workbook.
Dim excelbook As Workbook = New Workbook()
'Add a group box to the first worksheet.
Dim box As GroupBox = excelbook.Worksheets(0).Shapes.AddGroupBox(1, 0, 1, 0, 300, 250)
'Set the caption of the group box.
box.Text = "Age Groups"
box.Placement = PlacementType.FreeFloating
'Make it 2-D box.
box.Shadow = False
'Add a radio button.
Dim radio1 As RadioButton = excelbook.Worksheets(0).Shapes.AddRadioButton(3, 0, 2, 0, 30, 110)
'Set its text string.
radio1.Text = "20-29"
'Set A1 cell as a linked cell for the radio button.
radio1.LinkedCell = "A1"
'Make the radio button 3-D.
radio1.Shadow = True
'Make the fill format visible.
radio1.Fill.FillType = FillType.Solid
'Set the foreground color of the radio button.
radio1.Fill.SolidFill.Color = Color.LightGreen
'Make the line format visible.
radio1.Line.FillType = FillType.Solid
'Set the line style of the radio button.
radio1.Line.CompoundType = MsoLineStyle.ThickThin
'Set the weight of the radio button.
radio1.Line.Weight = 4
'Set the line color of the radio button.
radio1.Line.SolidFill.Color = Color.Blue
'Set the dash style of the radio button.
radio1.Line.DashStyle = MsoLineDashStyle.Solid
'Add another radio button.
Dim radio2 As RadioButton = excelbook.Worksheets(0).Shapes.AddRadioButton(6, 0, 2, 0, 30, 110)
'Set its text string.
radio2.Text = "30-39"
'Set A1 cell as a linked cell for the radio button.
radio2.LinkedCell = "A1"
'Make the radio button 3-D.
radio2.Shadow = True
'Make the fill format visible.
radio2.Fill.FillType = FillType.Solid
'Set the foreground color of the radio button.
radio2.Fill.SolidFill.Color = Color.LightGreen
'Make the line format visible.
radio2.Line.FillType = FillType.Solid
'Set the line style of the radio button.
radio2.Line.CompoundType = MsoLineStyle.ThickThin
'Set the weight of the radio button.
radio2.Line.Weight = 4
'Set the line color of the radio button.
radio2.Line.SolidFill.Color = Color.Blue
'Set the dash style of the radio button.
radio2.Line.DashStyle = MsoLineDashStyle.Solid
'Add another radio button.
Dim radio3 As RadioButton = excelbook.Worksheets(0).Shapes.AddRadioButton(9, 0, 2, 0, 30, 110)
'Set its text string.
radio3.Text = "40-49"
'Set A1 cell as a linked cell for the radio button.
radio3.LinkedCell = "A1"
'Make the radio button 3-D.
radio3.Shadow = True
'Make the fill format visible.
radio3.Fill.FillType = FillType.Solid
'Set the foreground color of the radio button.
radio3.Fill.SolidFill.Color = Color.LightGreen
'Make the line format visible.
radio3.Line.FillType = FillType.Solid
'Set the line style of the radio button.
radio3.Line.CompoundType = MsoLineStyle.ThickThin
'Set the weight of the radio button.
radio3.Line.Weight = 4
'Set the line color of the radio button.
radio3.Line.SolidFill.Color = Color.Blue
'Set the dash style of the radio button.
radio3.Line.DashStyle = MsoLineDashStyle.Solid
'Get the shapes.
Dim shapeobjects() As Shape = New Shape() {box, radio1, radio2, radio3}
'Group the shapes.
Dim group As GroupShape = excelbook.Worksheets(0).Shapes.Group(shapeobjects)
'Save the excel file.
excelbook.Save("groupshapes.xls")
Properties
this[int]
Gets the child shape by index.
public Shape this[int index] { get; }
Property Value
Methods
GetGroupedShapes()
Gets the shapes grouped by this shape.
public Shape[] GetGroupedShapes()
Returns
Shape[]
Ungroup()
Ungroups the shape items.
public void Ungroup()
Remarks
If the group shape is grouped by another group shape,nothing will be done.