Inheritance diagram for Edit:
Public Member Functions | |
SelectAll (void) | |
Selects all the text in the edit control. | |
ClearSelection (void) | |
Removes any text selection in the edit control. | |
ReplaceSelection ([in] BSTR newText,[in, defaultvalue(FALSE)] VARIANT_BOOL CanUndo) | |
The method replaces the selected text in the control with the specified text. | |
Undo (void) | |
If the undo queue of the control is not empty, you can use the Undo method to undo the most recent operation. | |
Cut (void) | |
Cuts the current selection to the clipboard. | |
Copy (void) | |
Copies the current selection to the clipboard. | |
Paste (void) | |
Pastes a text from the clipboard into the control. | |
Properties | |
VARIANT_BOOL RW | ReadOnly [] |
Use this property to prevent the user from typing or editing text in the edit control. | |
LONG RW | MaxLength [] |
Specifies the text limit (maximum text length) of the edit control. | |
LONG RW | CharCase [] |
Specifies convertion of characters to lowercase or uppercase. | |
BSTR RW | PasswordChar [] |
Specifies the password character for the edit control. | |
VARIANT_BOOL RW | HideSelection [] |
By default an edit control hides the selection when the control loses the input focus and inverts the selection when the control receives the input focus. | |
VARIANT_BOOL RW | MultiLine [] |
Specifies that the control is a multiline edit control. | |
ULONG RW | ScrollBars [] |
Specifies scrollbars of the control. | |
VARIANT_BOOL RW | AutoSize [] |
Specifies that the height of the control is determined automaticly by the font of the control. | |
VARIANT_BOOL RW | Modified [] |
Gets or sets the state of the edit control's modification flag which indicates whether the contents of the edit control have been modified. | |
LONG RW | SelStart [] |
Gets or sets the starting character position of the current selection in the edit control. | |
LONG RW | SelEnd [] |
Gets or sets the ending character position of the current selection in the edit control. | |
LONG RW | SelLength [] |
Gets or sets the length of the current selection in the edit control. | |
USHORT RW | LeftMargin [] |
Specifies the width of the left margin for the control, in pixels. | |
USHORT RW | RightMargin [] |
Specifies the width of the right margin for the control, in pixels. | |
VARIANT_BOOL RW | WordWrap [] |
Specifies word-wrapping for the control. | |
USHORT RW | TextAlign [] |
Specifies the text alignment for the control. | |
VARIANT_BOOL RW | CanUndo [] |
Specifies whether there are any actions in the control's undo queue. | |
VARIANT_BOOL R | CanPaste [] |
Specifies that the clipboard contains a text that can be pasted into the control. | |
LONG RW | DataType [] |
Specifies the data type for the control. | |
VARIANT RW | Min [] |
Specifies the minumum numberic value that can be stored in the control. | |
VARIANT RW | Max [] |
Specifies the maximum numberic value that can be stored in the control. | |
R | LineFromChar [] |
Retrieves the index of the line that contains the specified character index in the control. | |
VARIANT_BOOL RW | AcceptsReturn [] |
Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into the control. | |
VARIANT_BOOL RW | AcceptsTab [] |
Specifies that a tab sumbol be inserted when the user presses the TAB key while entering text into the control. | |
VARIANT_BOOL RW | AutoHeight [] |
Specifies that the height of the control is determined automaticly by the text of the control. | |
BSTR RW | CueBanner [] |
Specifies the cue banner text. | |
VARIANT_BOOL RW | CueBannerAlwaysVisible [] |
If specified true then the cue banner (specified by CueBanner) will be visible even when the control has focus. | |
IDispatch *R | BalloonTip [] |
Returns BalloonTip object for configuration an Balloon Tip options. |
When the user changes a text, the OnChange event occur.
See also the CreateEdit method of the Frame.
Example:
o = new ActiveXObject("Scripting.WindowSystemObject") o.EnableVisualStyles = true f = o.CreateForm(0,0,0,0) f.Text = "WSO" f.ClientWidth = 200 f.ClientHeight = 100 f.CenterControl() f.CreateEdit(10,10,100,25).Text = "Text" f.Show() o.Run()
ClearSelection | ( | void | ) |
Removes any text selection in the edit control.
Copy | ( | void | ) |
Copies the current selection to the clipboard.
Cut | ( | void | ) |
Cuts the current selection to the clipboard.
Paste | ( | void | ) |
Pastes a text from the clipboard into the control.
ReplaceSelection | ( | [in] BSTR | newText, | |
[in, defaultvalue(FALSE)] VARIANT_BOOL | CanUndo | |||
) |
The method replaces the selected text in the control with the specified text.
newText | Replacement text. | |
CanUndo | Allows undo after replacement. |
SelectAll | ( | void | ) |
Selects all the text in the edit control.
Undo | ( | void | ) |
If the undo queue of the control is not empty, you can use the Undo method to undo the most recent operation.
VARIANT_BOOL RW AcceptsReturn |
Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into the control.
VARIANT_BOOL RW AcceptsTab |
Specifies that a tab sumbol be inserted when the user presses the TAB key while entering text into the control.
VARIANT_BOOL RW AutoHeight |
Specifies that the height of the control is determined automaticly by the text of the control.
Used only for multi line controls.
o = new ActiveXObject("Scripting.WindowSystemObject") f = o.CreateForm(0,0,0,0) f.ClientWidth = 500 f.ClientHeight = 300 f.CenterControl() r = f.CreateRichEdit(10,10,400,10) r.AutoHeight = true b = f.CreateButton(420,10,75,25,"Add line") b.OnClick = ButtonAddClick b = f.CreateButton(420,40,75,25,"Remove line") b.OnClick = ButtonRemoveLine function ButtonAddClick() { r.Add("New Line") } function ButtonRemoveLine() { if (r.Count > 0) r.Remove(r.Count-1) } f.Show() o.Run()
VARIANT_BOOL RW AutoSize |
Specifies that the height of the control is determined automaticly by the font of the control.
Used only for single line controls. Default value: "TRUE"
IDispatch* R BalloonTip |
Returns BalloonTip object for configuration an Balloon Tip options.
Minimum OS: Windows XP. Requires visual styles (Themes).
VARIANT_BOOL R CanPaste |
Specifies that the clipboard contains a text that can be pasted into the control.
VARIANT_BOOL RW CanUndo |
Specifies whether there are any actions in the control's undo queue.
If the undo queue is not empty, you can use the Undo method to undo the most recent operation.
LONG RW CharCase |
Specifies convertion of characters to lowercase or uppercase.
Edit: converts all characters in the control.
RichEdit: converts input characters in the control.
This parameter can be a one of the following values:
BSTR RW CueBanner |
Specifies the cue banner text.
Minimum OS: Windows XP. Requires visual styles (Themes). The control must be in single line mode.
o = new ActiveXObject("Scripting.WindowSystemObject") o.EnableVisualStyles = true f = o.CreateForm(0,0,0,0) f.ClientWidth = 500 f.ClientHeight = 200 f.CenterControl() f.TextOut(10,10,"Note. Themes must be enabled") Edit = f.CreateEdit(10,30,480,25) Edit.CueBanner = "Enter text where" Edit.CueBannerAlwaysVisible = true Button = f.CreateButton(10,120,75,25,"Close") Button.OnClick = CloseFormHandler f.Show() o.Run() function CloseFormHandler(Sender) { Sender.Form.Close() }
VARIANT_BOOL RW CueBannerAlwaysVisible |
LONG RW DataType |
Specifies the data type for the control.
See also Data types.
VARIANT_BOOL RW HideSelection |
By default an edit control hides the selection when the control loses the input focus and inverts the selection when the control receives the input focus.
To have a control inverts selection always, set HideSelection to true.
USHORT RW LeftMargin |
Specifies the width of the left margin for the control, in pixels.
R LineFromChar |
Retrieves the index of the line that contains the specified character index in the control.
Index | Character index, if this parameter equals to -1, property retrieves either the line number of the current line (the line containing the caret) or, if there is a selection, the line number of the line containing the beginning of the selection. |
VARIANT RW Max |
Specifies the maximum numberic value that can be stored in the control.
DataType must be specified.
LONG RW MaxLength |
Specifies the text limit (maximum text length) of the edit control.
VARIANT RW Min |
Specifies the minumum numberic value that can be stored in the control.
DataType must be specified.
VARIANT_BOOL RW Modified |
Gets or sets the state of the edit control's modification flag which indicates whether the contents of the edit control have been modified.
VARIANT_BOOL RW MultiLine |
Specifies that the control is a multiline edit control.
Example:
o = new ActiveXObject("Scripting.WindowSystemObject") o.EnableVisualStyles = true f = o.CreateForm(0,0,0,0) f.Text = "WSO" f.ClientWidth = 200 f.ClientHeight = 100 f.CenterControl() Edit = f.CreateEdit(10,10,180,25) Edit.MultiLine = true Edit.Height = 80 Edit.Add("Line 1") Edit.Add("Line 2") Edit.Add("Line 3") f.Show() o.Run()
BSTR RW PasswordChar |
Specifies the password character for the edit control.
When a password character is specified, that character is displayed in place of the characters typed by the user.
VARIANT_BOOL RW ReadOnly |
Use this property to prevent the user from typing or editing text in the edit control.
USHORT RW RightMargin |
Specifies the width of the right margin for the control, in pixels.
ULONG RW ScrollBars |
Specifies scrollbars of the control.
This parameter can be a one of the following values:
LONG RW SelEnd |
Gets or sets the ending character position of the current selection in the edit control.
LONG RW SelLength |
Gets or sets the length of the current selection in the edit control.
LONG RW SelStart |
Gets or sets the starting character position of the current selection in the edit control.
USHORT RW TextAlign |
VARIANT_BOOL RW WordWrap |
Specifies word-wrapping for the control.