Edit Interface Reference

Edit control is a control in which the user can enter and edit text. More...

Inheritance diagram for Edit:

Inheritance graph
Collaboration diagram for Edit:

Collaboration graph
List of all members.

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.
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.

Detailed Description

Edit control is a control in which the user can enter and edit text.

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()

Result:
Edit.jpg


Member Function Documentation

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.

Parameters:
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.


Property Documentation

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.

Note:
Only for RichEdit.
Since:
1.1.7
Example (JScript):

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).

Since:
1.1.8.

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.

Since:
1.1.8.
Example (JScript):

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()
}

Result:

CueBanner.jpg

VARIANT_BOOL RW CueBannerAlwaysVisible

If specified true then the cue banner (specified by CueBanner) will be visible even when the control has focus.

Minimum OS: Windows XP. Requires visual styles (Themes).

Since:
1.1.8.

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.

Parameters:
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()

Result:
EditMultiline.jpg

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:

Note:

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

Specifies the text alignment for the control.

This parameter can be a one of the following values:

Note:
RichEdit: used only for the current paragraph (see also Paragraph).

VARIANT_BOOL RW WordWrap

Specifies word-wrapping for the control.


WSO 1.1 Documentation. Date modified:Wed Aug 12 18:12:32 2015. (C) Veretennikov A. B. 2004-2015