public class ToggleButtonActiveXControl extends ActiveXControl
Example
//Initialize a new workbook.
Workbook book = new Workbook();
//Add a ToggleButtonActiveXControl.
Shape shape = book.getWorksheets().get(0).getShapes().addActiveXControl(ControlType.TOGGLE_BUTTON, 1, 0, 1, 0, 100, 50);
ToggleButtonActiveXControl activeXControl = (ToggleButtonActiveXControl)shape.getActiveXControl();
//do your business
//Save the excel file.
book.save("exmaple.xlsx");
| Modifier and Type | Method and Description |
|---|---|
char |
getAccelerator()
Gets the accelerator key for the control.
|
java.lang.String |
getCaption()
Gets the descriptive text that appears on a control.
|
byte[] |
getPicture()
Gets the data of the picture.
|
int |
getPicturePosition()
Gets the location of the control's picture relative to its caption.
|
int |
getSpecialEffect()
Gets the special effect of the control.
|
int |
getType()
Gets the type of the ActiveX control.
|
int |
getValue()
Indicates if the control is checked or not.
|
boolean |
isTripleState()
Indicates how the specified control will display Null values.
|
void |
setAccelerator(char value)
Sets the accelerator key for the control.
|
void |
setCaption(java.lang.String value)
Sets the descriptive text that appears on a control.
|
void |
setPicture(byte[] value)
Sets the data of the picture.
|
void |
setPicturePosition(int value)
Sets the location of the control's picture relative to its caption.
|
void |
setSpecialEffect(int value)
Sets the special effect of the control.
|
void |
setTripleState(boolean value)
Indicates how the specified control will display Null values.
|
void |
setValue(int value)
Indicates if the control is checked or not.
|
getData, getFont, getIMEMode, getTextAlign, isAutoSize, isEnabled, isLocked, isTransparent, setAutoSize, setEnabled, setIMEMode, setLocked, setTextAlign, setTransparentgetBackOleColor, getForeOleColor, getHeight, getLinkedCell, getListFillRange, getMouseIcon, getMousePointer, getShadow, getWidth, getWorkbook, isVisible, setBackOleColor, setForeOleColor, setHeight, setLinkedCell, setListFillRange, setMouseIcon, setMousePointer, setShadow, setVisible, setWidthpublic int getType()
See ControlType.
Example
/*Aspose.Cells.Drawing.ActiveXControls.ControlType*/int type = activeXControl.getType();
getType in class ActiveXControlBasepublic java.lang.String getCaption()
Example
activeXControl.setCaption("ExampleButton");
public void setCaption(java.lang.String value)
public int getPicturePosition()
See ControlPicturePositionType.
Example
activeXControl.setPicturePosition(com.aspose.cells.ControlPicturePositionType.ABOVE_LEFT);
public void setPicturePosition(int value)
public int getSpecialEffect()
Example
activeXControl.setSpecialEffect(com.aspose.cells.ControlSpecialEffectType.BUMP);
public void setSpecialEffect(int value)
public byte[] getPicture()
Example
//e.g byte[] data = File.ReadAllBytes("image.png");
byte[] data = null;
if(activeXControl.getPicture() != null)
{
activeXControl.setPicture(data);
}
public void setPicture(byte[] value)
public char getAccelerator()
Example
if (' ' != activeXControl.getAccelerator())
{
activeXControl.setAccelerator(' ');
}
public void setAccelerator(char value)
public int getValue()
See CheckValueType.
Example
if(activeXControl.getValue() == CheckValueType.UN_CHECKED)
{
activeXControl.setValue(CheckValueType.CHECKED);
}
public void setValue(int value)
See CheckValueType.
public boolean isTripleState()
Remarks
| Setting | Description |
|---|---|
| True | The 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. |
Example
activeXControl.setTripleState(false);
public void setTripleState(boolean value)
Remarks
| Setting | Description |
|---|---|
| True | The 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. |
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.