Class ToggleButtonActiveXControl

Class ToggleButtonActiveXControl

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

Represents a ToggleButton ActiveX control.

public class ToggleButtonActiveXControl : ActiveXControl

Inheritance

objectActiveXControlBaseActiveXControlToggleButtonActiveXControl

Derived

RadioButtonActiveXControl

Inherited Members

ActiveXControl.IsEnabled, ActiveXControl.IsLocked, ActiveXControl.IsTransparent, ActiveXControl.IsAutoSize, ActiveXControl.IMEMode, ActiveXControl.Font, ActiveXControl.TextAlign, ActiveXControl.Data, ActiveXControlBase.Workbook, ActiveXControlBase.Type, ActiveXControlBase.Width, ActiveXControlBase.Height, ActiveXControlBase.MouseIcon, ActiveXControlBase.MousePointer, ActiveXControlBase.ForeOleColor, ActiveXControlBase.BackOleColor, ActiveXControlBase.IsVisible, ActiveXControlBase.Shadow, ActiveXControlBase.LinkedCell, ActiveXControlBase.ListFillRange, ActiveXControlBase.Data, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Examples

csharp
[C#]
//Initialize a new workbook.
Workbook book = new Workbook();

//Add a ToggleButtonActiveXControl.
Shape shape = book.Worksheets[0].Shapes.AddActiveXControl(ControlType.ToggleButton, 1, 0, 1, 0, 100, 50);
ToggleButtonActiveXControl activeXControl = (ToggleButtonActiveXControl)shape.ActiveXControl;

//do your business

//Save the excel file.
book.Save("exmaple.xlsx");

Properties

Accelerator

Gets and sets the accelerator key for the control.

public char Accelerator { get; set; }

Property Value

char

Examples

csharp
[C#]
if ('\0' != activeXControl.Accelerator)
{
    activeXControl.Accelerator = '\0';
}

Caption

Gets and set the descriptive text that appears on a control.

public string Caption { get; set; }

Property Value

string

Examples

csharp
[C#]
activeXControl.Caption = "ExampleButton";

IsTripleState

Indicates how the specified control will display Null values.

public bool IsTripleState { get; set; }

Property Value

bool

Examples

csharp
[C#]
activeXControl.IsTripleState = false;

Remarks

SettingDescription
TrueThe control will cycle through states for Yes, No, and Null values. The control appears dimmed (grayed) when its Value property is set to Null.
False(Default) The control will cycle through states for Yes and No values. Null values display as if they were No values.

Picture

Gets and sets the data of the picture.

public byte[] Picture { get; set; }

Property Value

byte[]

Examples

csharp
[C#]
//e.g byte[] data = File.ReadAllBytes("image.png");
byte[] data = null;
if(activeXControl.Picture != null)
{
    activeXControl.Picture = data;
}

PicturePosition

Gets and set the location of the control’s picture relative to its caption.

public ControlPicturePositionType PicturePosition { get; set; }

Property Value

ControlPicturePositionType

Examples

csharp
[C#]
activeXControl.PicturePosition = Aspose.Cells.Drawing.ActiveXControls.ControlPicturePositionType.AboveLeft;

SpecialEffect

Gets and sets the special effect of the control.

public ControlSpecialEffectType SpecialEffect { get; set; }

Property Value

ControlSpecialEffectType

Examples

csharp
[C#]
activeXControl.SpecialEffect = Aspose.Cells.Drawing.ActiveXControls.ControlSpecialEffectType.Bump;

Type

Gets the type of the ActiveX control.

public override ControlType Type { get; }

Property Value

ControlType

Examples

csharp
[C#]
Aspose.Cells.Drawing.ActiveXControls.ControlType type = activeXControl.Type;

Value

Indicates if the control is checked or not.

public CheckValueType Value { get; set; }

Property Value

CheckValueType

Examples

csharp
[C#]
if(activeXControl.Value == CheckValueType.UnChecked)
{
    activeXControl.Value = CheckValueType.Checked;
}