TextBoxControl

TextBoxControl class

The TextBox control displays text from an organized set of data or user input.

public class TextBoxControl : MorphDataControl

Properties

NameDescription
Caption { get; }Gets Caption property of control. Default value is an empty string.
virtual ChildNodes { get; }Gets collection of immediate child controls.
Enabled { get; }Returns true if control is in enabled state.
GroupName { get; set; }Gets or sets a string that specifies a group of mutually exclusive controls. The default value is an empty string.
IsForms2OleControl { get; }Returns true if the control is a Forms2OleControl.
Name { get; set; }Gets or sets name of the ActiveX control.
Text { get; set; }Gets or sets a text of the control.
override Type { get; }Gets type of Forms 2.0 control.
Value { get; }Gets underlying Value property which often represents control state. For example checked option button has ‘1’ value while unchecked has ‘0’. Default value is an empty string.

Examples

Shows how to change text of the TextBox OLE control.

Document doc = new Document(MyDir + "Textbox control.docm");

Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
TextBoxControl textBoxControl = (TextBoxControl)shape.OleFormat.OleControl;
Assert.AreEqual("Aspose.Words test", textBoxControl.Text);

textBoxControl.Text = "Updated text";
Assert.AreEqual("Updated text", textBoxControl.Text);

See Also