Class ActiveXControlBase
Contents
[
Hide
]ActiveXControlBase class
Represents the ActiveX control.
public abstract class ActiveXControlBase
Properties
Name | Description |
---|---|
virtual BackOleColor { get; set; } | Gets and sets the ole color of the background. |
virtual Data { get; } | Gets and sets the binary data of the control. |
virtual ForeOleColor { get; set; } | Gets and sets the ole color of the foreground. |
virtual Height { get; set; } | Gets and sets the height of the control in unit of points. |
virtual IsVisible { get; set; } | Indicates whether this control is visible. |
LinkedCell { get; set; } | Gets and sets the linked cell. |
ListFillRange { get; set; } | Gets and sets the list fill range. |
MouseIcon { get; set; } | Gets and sets a custom icon to display as the mouse pointer for the control. |
MousePointer { get; set; } | Gets and sets the type of icon displayed as the mouse pointer for the control. |
virtual Shadow { get; set; } | Indicates whether to show a shadow. |
abstract Type { get; } | Gets the type of the ActiveX control. |
virtual Width { get; set; } | Gets and sets the width of the control in unit of points. |
Workbook { get; } | Gets the Workbook object. |
Examples
[C#]
namespace Demos
{
using Aspose.Cells;
using Aspose.Cells.Drawing;
using Aspose.Cells.Drawing.ActiveXControls;
using System;
public class ActiveXControlBaseDemo
{
public static void ActiveXControlBaseExample()
{
// Create a new workbook
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
// Add an ActiveX control to the worksheet
var shape = worksheet.Shapes.AddActiveXControl(ControlType.CheckBox, 5, 0, 5, 0, 100, 20);
CheckBoxActiveXControl control = (CheckBoxActiveXControl)shape.ActiveXControl;
control.Font.Size = 20;
// Set properties of the ActiveX control
control.Width = 150;
control.Height = 30;
control.MousePointer = ControlMousePointerType.Arrow;
control.ForeOleColor = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red);
control.BackOleColor = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Yellow);
control.IsVisible = true;
control.Shadow = true;
control.LinkedCell = "A1";
control.ListFillRange = "A2:A10";
// Save the workbook
workbook.Save("ActiveXControlBaseExample.xlsx");
workbook.Save("ActiveXControlBaseExample.pdf", SaveFormat.Pdf);
}
}
}
See Also
- namespace Aspose.Cells.Drawing.ActiveXControls
- assembly Aspose.Cells