Class Button

Class Button

Namespace: Aspose.Cells.Drawing
Assembly: Aspose.Cells.dll (25.2.0)

Represents the Forms control: Button

public class Button : Shape

Inheritance

objectShapeButton

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#]

 //Create a new Workbook.
 Workbook workbook = new Workbook();

 //Get the first worksheet in the workbook.
 Worksheet sheet = workbook.Worksheets[0];

 //Add a new button to the worksheet.
 Aspose.Cells.Drawing.Button button = sheet.Shapes.AddButton(2, 0, 2, 0, 28, 80);

 //Set the caption of the button.
 button.Text = "Aspose";

 //Set the Placement Type, the way the
 //button is attached to the cells.
 button.Placement = PlacementType.FreeFloating;

 //Set the font name.
 button.Font.Name = "Tahoma";

 //Set the caption string bold.
 button.Font.IsBold = true;

 //Set the color to blue.
 button.Font.Color = Color.Blue;

 //Set the hyperlink for the button.
 button.AddHyperlink("http://www.aspose.com/");

 //Saves the file.
 workbook.Save(@"tstbutton.xls");

 'Create a new Workbook.
 Dim workbook As Workbook = New Workbook()

 'Get the first worksheet in the workbook.
 Dim sheet As Worksheet = workbook.Worksheets(0)

 'Add a new button to the worksheet.
 Dim button As Aspose.Cells.Drawing.Button = sheet.Shapes.AddButton(2, 0, 2, 0, 28, 80)

 'Set the caption of the button.
 button.Text = "Aspose"

 'Set the Placement Type, the way the
 'button is attached to the cells.
 button.Placement = PlacementType.FreeFloating

 'Set the font name.
 button.Font.Name = "Tahoma"

 'Set the caption string bold.
 button.Font.IsBold = True

 'Set the color to blue.
 button.Font.Color = Color.Blue

 'Set the hyperlink for the button.
 button.AddHyperlink("http://www.aspose.com/")

 'Saves the file.
 workbook.Save("tstbutton.xls")