Class TextBoxActiveXControl

Class TextBoxActiveXControl

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

Represents a text box ActiveX control.

public class TextBoxActiveXControl : ActiveXControl

Inheritance

objectActiveXControlBaseActiveXControlTextBoxActiveXControl

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 TextBoxActiveXControl.
Shape shape = book.Worksheets[0].Shapes.AddActiveXControl(ControlType.TextBox, 1, 0, 1, 0, 100, 50);
TextBoxActiveXControl activeXControl = (TextBoxActiveXControl)shape.ActiveXControl;

//do your business

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

Properties

BorderOleColor

Gets and sets the ole color of the background.

public int BorderOleColor { get; set; }

Property Value

int

Examples

csharp
[C#]
//excel default color system 12 or green(0x0000FF00)
activeXControl.BorderOleColor = unchecked((int)0x80000012);

BorderStyle

Gets and set the type of border used by the control.

public ControlBorderType BorderStyle { get; set; }

Property Value

ControlBorderType

Examples

csharp
[C#]
activeXControl.BorderStyle = Aspose.Cells.Drawing.ActiveXControls.ControlBorderType.Single;

DropButtonStyle

Specifies the symbol displayed on the drop button

public DropButtonStyle DropButtonStyle { get; set; }

Property Value

DropButtonStyle

Examples

csharp
[C#]
activeXControl.DropButtonStyle = Aspose.Cells.Drawing.ActiveXControls.DropButtonStyle.Arrow;

EnterFieldBehavior

Specifies selection behavior when entering the control. True specifies that the selection remains unchanged from last time the control was active. False specifies that all the text in the control will be selected when entering the control.

public bool EnterFieldBehavior { get; set; }

Property Value

bool

Examples

csharp
[C#]
if(!activeXControl.EnterFieldBehavior)
{
    activeXControl.EnterFieldBehavior = true;
}

EnterKeyBehavior

Specifies the behavior of the ENTER key. True specifies that pressing ENTER will create a new line. False specifies that pressing ENTER will move the focus to the next object in the tab order.

public bool EnterKeyBehavior { get; set; }

Property Value

bool

Examples

csharp
[C#]
if(!activeXControl.EnterKeyBehavior)
{
    activeXControl.EnterKeyBehavior = true;
}

HideSelection

Indicates whether selected text in the control appears highlighted when the control does not have focus.

public bool HideSelection { get; set; }

Property Value

bool

Examples

csharp
[C#]
if(!activeXControl.HideSelection)
{
    activeXControl.HideSelection = true;
}

IntegralHeight

Indicates whether the control will only show complete lines of text without showing any partial lines.

public bool IntegralHeight { get; set; }

Property Value

bool

Examples

csharp
[C#]
if(!activeXControl.IntegralHeight)
{
    activeXControl.IntegralHeight = true;
}

IsAutoTab

Indicates whether the focus will automatically move to the next control when the user enters the maximum number of characters.

public bool IsAutoTab { get; set; }

Property Value

bool

Examples

csharp
[C#]
if(!activeXControl.IsAutoTab)
{
    activeXControl.IsAutoTab = true;
}

IsAutoWordSelected

Specifies the basic unit used to extend a selection. True specifies that the basic unit is a single character. false specifies that the basic unit is a whole word.

public virtual bool IsAutoWordSelected { get; set; }

Property Value

bool

Examples

csharp
[C#]
if(!activeXControl.IsAutoWordSelected)
{
    activeXControl.IsAutoWordSelected = true;
}

IsDragBehaviorEnabled

Indicates whether dragging and dropping is enabled for the control.

public bool IsDragBehaviorEnabled { get; set; }

Property Value

bool

Examples

csharp
[C#]
if(!activeXControl.IsDragBehaviorEnabled)
{
    activeXControl.IsDragBehaviorEnabled = true;
}

IsEditable

Indicates whether the user can type into the control.

public bool IsEditable { get; set; }

Property Value

bool

Examples

csharp
[C#]
if(!activeXControl.IsEditable)
{
    activeXControl.IsEditable = true;
}

IsMultiLine

Indicates whether the control can display more than one line of text.

public bool IsMultiLine { get; set; }

Property Value

bool

Examples

csharp
[C#]
if(!activeXControl.IsMultiLine)
{
    activeXControl.IsMultiLine = true;
}

IsWordWrapped

Indicates whether the contents of the control automatically wrap at the end of a line.

public bool IsWordWrapped { get; set; }

Property Value

bool

Examples

csharp
[C#]
if(!activeXControl.IsWordWrapped)
{
    activeXControl.IsWordWrapped = true;
}

MaxLength

Gets and sets the maximum number of characters

public int MaxLength { get; set; }

Property Value

int

Examples

csharp
[C#]
if(activeXControl.MaxLength == 0)
{
    activeXControl.MaxLength = 30;
}

PasswordChar

Gets and sets a character to be displayed in place of the characters entered.

public char PasswordChar { get; set; }

Property Value

char

Examples

csharp
[C#]
activeXControl.PasswordChar = 'a';

ScrollBars

Indicates specifies whether the control has vertical scroll bars, horizontal scroll bars, both, or neither.

public ControlScrollBarType ScrollBars { get; set; }

Property Value

ControlScrollBarType

Examples

csharp
[C#]
activeXControl.ScrollBars = Aspose.Cells.Drawing.ActiveXControls.ControlScrollBarType.BarsVertical;

ShowDropButtonTypeWhen

Specifies the symbol displayed on the drop button

public ShowDropButtonType ShowDropButtonTypeWhen { get; set; }

Property Value

ShowDropButtonType

Examples

csharp
[C#]
activeXControl.ShowDropButtonTypeWhen = Aspose.Cells.Drawing.ActiveXControls.ShowDropButtonType.Focus;

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;

TabKeyBehavior

Indicates whether tab characters are allowed in the text of the control.

public bool TabKeyBehavior { get; set; }

Property Value

bool

Examples

csharp
[C#]
if(!activeXControl.TabKeyBehavior)
{
    activeXControl.TabKeyBehavior = true;
}

Text

Gets and set text of the control.

public string Text { get; set; }

Property Value

string

Examples

csharp
[C#]
activeXControl.Text = "This is a test.";

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;