GroupShape

GroupShape class

Represents the group shape which contains the individual shapes.

public class GroupShape : Shape

Properties

Name Description
ActiveXControl { get; } Gets the ActiveX control.
ActualLowerRightRow { get; } Get the actual bottom row.
AlternativeText { get; set; } Returns or sets the descriptive (alternative) text string of the Shape object.
AnchorType { get; set; } Gets and set the shape anchor placeholder.
AutoShapeType { get; set; } Gets and sets the auto shape type.
Bottom { get; set; } Represents the width of the shape’s vertical offset from its lower bottom corner row, in unit of pixels.
ConnectionPoints { get; } Get the connection points
ControlData { get; } Gets the data of control.
CreateId { get; set; } Gets and sets create id for this shape.
Fill { get; } Returns a FillFormat object that contains fill formatting properties for the specified shape.
FillFormat { get; } Returns a MsoFillFormat object that contains fill formatting properties for the specified shape.
Font { get; set; } Represents the font of shape.
Format { get; } Represents the setting of the shape’s formatting.
FormatPicture { get; } Gets and sets the options of the picture format.
Geometry { get; } Gets the geometry
Glow { get; } Represents a object that specifies glow effect for the chart element or shape.
Group { get; } Gets the group shape which contains this shape.
HasLine { get; set; } Gets and sets the line border of the shape is visible.
Height { get; set; } Represents the height of shape, in unit of pixel.
HeightCM { get; set; } Represents the height of the shape, in unit of centimeters.
HeightInch { get; set; } Represents the height of the shape, in unit of inches.
HeightInShape { get; set; } Represents the vertical offset of shape from the top border of the parent shape, in unit of 1/4000 of height of the parent shape..
HeightPt { get; set; } Represents the height of the shape, in unit of points.
HeightScale { get; set; } Gets and sets the height scale,in unit of percent of the original picture height. If the shape is not picture ,the HeightScale property only returns 100;
HtmlText { get; set; } Gets and sets the html string which contains data and some formats in this textbox.
Hyperlink { get; } Gets the hyperlink of the shape.
Id { get; } Gets the identifier of this shape.
InputRange { get; set; } Gets or sets the worksheet range used to fill the specified combo box.
IsEquation { get; } Indicates whether the shape only contains an equation.
IsFilled { get; set; } Indicates whether the fill format is visible.
IsFlippedHorizontally { get; set; } Gets and sets whether shape is horizontally flipped .
IsFlippedVertically { get; set; } Gets and sets whether shape is vertically flipped .
IsGroup { get; } Indicates whether the shape is a group.
IsHidden { get; set; } Indicates whether the object is visible.
IsInGroup { get; } Indicates whether the shape is grouped.
IsLockAspectRatio { get; set; } True means that don’t allow changes in aspect ratio.
IsLocked { get; set; } True if the object is locked, False if the object can be modified when the sheet is protected.
IsPrintable { get; set; } True if the object is printable
IsRichText { get; } Whether or not the text is rich text.
IsSmartArt { get; } Indicates whether the shape is smart art.
IsTextWrapped { get; set; } Gets and sets the text wrapped type of the shape which contains text.
IsWordArt { get; } Indicates whether this shape is a word art.
Item { get; } Gets the child shape by index.
Left { get; set; } Represents the horizontal offset of shape from its left column, in unit of pixels.
LeftCM { get; set; } Represents the horizontal offset of shape from its left column, in unit of centimeters.
LeftInch { get; set; } Represents the horizontal offset of shape from its left column, in unit of inches.
LeftInShape { get; set; } Represents the horizontal offset of shape from the left border of the parent shape, in unit of 1/4000 of width of the parent shape.
LeftToCorner { get; set; } Gets and sets the horizonal offset of shape from worksheet left border.
Line { get; } Gets line style
LineFormat { get; } Returns a MsoLineFormat object that contains line formatting properties for the specified shape.
LinkedCell { get; set; } Gets or sets the worksheet range linked to the control’s value.
LowerDeltaX { get; set; } Gets or sets the shape’s horizontal offset from its lower right corner column. The range of value is 0 to 1024.
LowerDeltaY { get; set; } Gets or sets the shape’s vertical offset from its lower right corner row. The range of value is 0 to 256.
LowerRightColumn { get; set; } Represents lower right corner column index.
LowerRightRow { get; set; } Represents lower right corner row index.
MacroName { get; set; } Gets and sets the name of macro.
MsoDrawingType { get; } Gets mso drawing type.
Name { get; set; } Gets and sets the name of the shape.
Paths { get; } Gets the paths of a custom geometric shape.
Placement { get; set; } Represents the way the drawing object is attached to the cells below it. The property controls the placement of an object on a worksheet.
Reflection { get; } Represents a object that specifies reflection effect for the chart element or shape.
RelativeToOriginalPictureSize { get; set; } Indicates whether shape is relative to original picture size.
Right { get; set; } Represents the width of the shape’s horizontal offset from its lower right corner column, in unit of pixels.
RotationAngle { get; set; } Gets and sets the rotation of the shape.
ShadowEffect { get; } Represents a object that specifies shadow effect for the chart element or shape.
SoftEdges { get; set; } Gets and sets the radius of blur to apply to the edges, in unit of points.
Spid { get; } Specifies an optional string that an application can use to Identify the particular shape.
Spt { get; } Specifies an optional number that an application can use to associate the particular shape with a defined shape type.
Text { get; set; } Represents the string in this TextBox object.
TextBody { get; } Gets and sets the setting of the shape’s text.
TextDirection { get; set; } Gets/Sets the direction of the text flow for this object.
TextEffect { get; } Returns a TextEffectFormat object that contains text-effect formatting properties for the specified shape. Applies to Shape objects that represent WordArt.
TextFrame { get; } Returns a TextFrame object that contains the alignment and anchoring properties for the specified shape.
TextHorizontalAlignment { get; set; } Gets and sets the text horizontal alignment type of the shape.
TextHorizontalOverflow { get; set; } Gets and sets the text horizontal overflow type of the shape which contains text.
TextOptions { get; set; } Represents the text options of the shape.
TextOrientationType { get; set; } Gets and sets the text orientation type of the shape.
TextShapeType { get; set; } Gets and sets the preset text shape type.
TextVerticalAlignment { get; set; } Gets and sets the text vertical alignment type of the shape.
TextVerticalOverflow { get; set; } Gets and sets the text vertical overflow type of the shape which contains text.
ThreeDFormat { get; } Gets and sets 3d format of the shape.
Title { get; set; } Specifies the title (caption) of the current shape object.
Top { get; set; } Represents the vertical offset of shape from its top row, in unit of pixels.
TopCM { get; set; } Represents the vertical offset of shape from its top row, in unit of centimeters.
TopInch { get; set; } Represents the vertical offset of shape from its top row, in unit of inches.
TopInShape { get; set; } Represents the vertical offset of shape from the top border of the parent shape, in unit of 1/4000 of height of the parent shape.
TopToCorner { get; set; } Gets and sets the vertical offset of shape from worksheet top border, in unit of pixels.
Type { get; } Gets the auto shape type.
UpperDeltaX { get; set; } Gets or sets the shape’s horizontal offset from its upper left corner column. The range of value is 0 to 1024.
UpperDeltaY { get; set; } Gets or sets the shape’s vertical offset from its upper left corner row. The range of value is 0 to 256.
UpperLeftColumn { get; set; } Represents upper left corner column index.
UpperLeftRow { get; set; } Represents upper left corner row index.
Width { get; set; } Represents the width of shape, in unit of pixels.
WidthCM { get; set; } Represents the width of the shape, in unit of centimeters.
WidthInch { get; set; } Represents the width of the shape, in unit of inch.
WidthInShape { get; set; } Represents the width of the shape, in unit of 1/4000 of the parent shape.
WidthPt { get; set; } Represents the width of the shape, in unit of point.
WidthScale { get; set; } Gets and sets the width scale, in unit of percent of the original picture width. If the shape is not picture ,the WidthScale property only returns 100;
Worksheet { get; } Gets the Worksheet object which contains this shape.
X { get; set; } Gets and sets the horizontal offset of shape from worksheet left border,in unit of pixels.
Y { get; set; } Gets and sets the vertical offset of shape from worksheet top border,in unit of pixels.
ZOrderPosition { get; set; } Returns the position of a shape in the z-order.

Methods

Name Description
AddHyperlink(string) Adds a hyperlink to the shape.
AlignTopRightCorner(int, int) Moves the picture to the top-right corner.
CalculateTextSize() Recalculate the text area
Characters(int, int) Returns a Characters object that represents a range of characters within the text.
FormatCharacters(int, int, Font) Formats some characters with the font setting.
FormatCharacters(int, int, Font, StyleFlag) Formats some characters with the font setting.
GetCharacters() Returns all Characters objects that represents a range of characters within the text .
GetConnectionPoints() Get the connection points
GetGroupedShapes() Gets the shapes grouped by this shape.
GetInputRange(bool, bool) Gets the range used to fill the control.
GetLinkedCell(bool, bool) Gets the range linked to the control’s value.
GetLockedProperty(ShapeLockType) Gets the value of locked property.
virtual GetResultOfSmartArt() Converting smart art to grouped shapes.
virtual IsSameSetting(object) Returns whether the shape is same.
MoveToRange(int, int, int, int) Moves the shape to a specified range.
RemoveActiveXControl() Remove activeX control.
RemoveHyperlink() Remove the hyperlink of the shape.
SetInputRange(string, bool, bool) Sets the range used to fill the control.
SetLinkedCell(string, bool, bool) Sets the range linked to the control’s value.
SetLockedProperty(ShapeLockType, bool) Set the locked property.
ToFrontOrBack(int) Brings the shape to the front or sends the shape to back.
ToImage(ImageOrPrintOptions) Returns the bitmap object of the shape .
ToImage(Stream, ImageFormat) Creates the shape image and saves it to a stream in the specified format.
ToImage(Stream, ImageOrPrintOptions) Saves the shape to a stream.
ToImage(string, ImageOrPrintOptions) Saves the shape to a file.
Ungroup() Ungroups the shape items.
UpdateSelectedValue() Update the selected value by the value of the linked cell.

Examples


[C#]

//Instantiate a new Workbook.
Workbook excelbook = new Workbook();
 
//Add a group box to the first worksheet.
Aspose.Cells.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.
Aspose.Cells.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;
 
//Set the foreground color of the radio button.
radio1.FillFormat.ForeColor = Color.LightGreen;
 
//Set the line style of the radio button.
radio1.LineFormat.Style = MsoLineStyle.ThickThin;
 
//Set the weight of the radio button.
radio1.LineFormat.Weight = 4;
 
//Set the line color of the radio button.
radio1.LineFormat.ForeColor = Color.Blue;
 
//Set the dash style of the radio button.
radio1.LineFormat.DashStyle = MsoLineDashStyle.Solid;
 
//Make the line format visible.
radio1.LineFormat.IsVisible = true;
 
//Make the fill format visible.
radio1.FillFormat.IsVisible = true;
 
//Add another radio button.
Aspose.Cells.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;
 
//Set the foreground color of the radio button.
radio2.FillFormat.ForeColor = Color.LightGreen;
 
//Set the line style of the radio button.
radio2.LineFormat.Style = MsoLineStyle.ThickThin;
 
//Set the weight of the radio button.
radio2.LineFormat.Weight = 4;
 
//Set the line color of the radio button.
radio2.LineFormat.ForeColor = Color.Blue;
 
//Set the dash style of the radio button.
radio2.LineFormat.DashStyle = MsoLineDashStyle.Solid;
 
//Make the line format visible.
radio2.LineFormat.IsVisible = true;
 
//Make the fill format visible.
radio2.FillFormat.IsVisible = true;
 
//Add another radio button.
Aspose.Cells.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;
 
//Set the foreground color of the radio button.
radio3.FillFormat.ForeColor = Color.LightGreen;
 
//Set the line style of the radio button.
radio3.LineFormat.Style = MsoLineStyle.ThickThin;
 
//Set the weight of the radio button.
radio3.LineFormat.Weight = 4;
 
//Set the line color of the radio button.
radio3.LineFormat.ForeColor = Color.Blue;
 
//Set the dash style of the radio button.
radio3.LineFormat.DashStyle = MsoLineDashStyle.Solid;
 
//Make the line format visible.
radio3.LineFormat.IsVisible = true;
 
//Make the fill format visible.
radio3.FillFormat.IsVisible = true;
 
//Get the shapes.
Aspose.Cells.Shape[] shapeobjects = new Aspose.Cells.Shape[] { box, radio1, radio2, radio3 };
 
//Group the shapes.
Aspose.Cells.GroupShape group = excelbook.Worksheets[0].Shapes.Group(shapeobjects);
 
//Save the excel file.
excelbook.Save("groupshapes.xls");

[VB.NET]

'Instantiate a new Workbook.
Dim excelbook As Workbook = New Workbook()
 
'Add a group box to the first worksheet.
Dim box As Aspose.Cells.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 Aspose.Cells.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
 
'Set the foreground color of the radio button.
radio1.FillFormat.ForeColor = Color.LightGreen
 
'Set the line style of the radio button.
radio1.LineFormat.Style = MsoLineStyle.ThickThin
 
'Set the weight of the radio button.
radio1.LineFormat.Weight = 4
 
'Set the line color of the radio button.
radio1.LineFormat.ForeColor = Color.Blue
 
'Set the dash style of the radio button.
radio1.LineFormat.DashStyle = MsoLineDashStyle.Solid
 
'Make the line format visible.
radio1.LineFormat.IsVisible = True
 
'Make the fill format visible.
radio1.FillFormat.IsVisible = True
 
'Add another radio button.
Dim radio2 As Aspose.Cells.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
 
'Set the foreground color of the radio button.
radio2.FillFormat.ForeColor = Color.LightGreen
 
'Set the line style of the radio button.
radio2.LineFormat.Style = MsoLineStyle.ThickThin
 
'Set the weight of the radio button.
radio2.LineFormat.Weight = 4
 
'Set the line color of the radio button.
radio2.LineFormat.ForeColor = Color.Blue
 
'Set the dash style of the radio button.
radio2.LineFormat.DashStyle = MsoLineDashStyle.Solid
 
'Make the line format visible.
radio2.LineFormat.IsVisible = True
 
'Make the fill format visible.
radio2.FillFormat.IsVisible = True
 
'Add another radio button.
Dim radio3 As Aspose.Cells.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
 
'Set the foreground color of the radio button.
radio3.FillFormat.ForeColor = Color.LightGreen
 
'Set the line style of the radio button.
radio3.LineFormat.Style = MsoLineStyle.ThickThin
 
'Set the weight of the radio button.
radio3.LineFormat.Weight = 4
 
'Set the line color of the radio button.
radio3.LineFormat.ForeColor = Color.Blue
 
'Set the dash style of the radio button.
radio3.LineFormat.DashStyle = MsoLineDashStyle.Solid
 
'Make the line format visible.
radio3.LineFormat.IsVisible = True
 
'Make the fill format visible.
radio3.FillFormat.IsVisible = True
 
'Get the shapes.
Dim shapeobjects() As Aspose.Cells.Shape = New Aspose.Cells.Shape() {box, radio1, radio2, radio3}
 
'Group the shapes.
Dim group As Aspose.Cells.GroupShape = excelbook.Worksheets(0).Shapes.Group(shapeobjects)
 
'Save the excel file.
excelbook.Save("groupshapes.xls")

See Also