Clears selected text or other contents of a specified control.
To clear |
Use |
---|---|
Selected text from a specified control |
|
The contents of a Signature control |
Deletes selected text from the specified control, but does not store it in the clipboard.
DataWindow, EditMask, MultiLineEdit, SingleLineEdit, RichTextEdit, DropDownListBox, DropDownPictureListBox, OLE controls, and OLEStorage objects
objectname.Clear ( )
Argument |
Description |
---|---|
objectname |
One of the following:
If objectname is a DropDownListBox its AllowEdit property must be true. |
Long.
For edit controls, returns the number of characters that Clear removed from objectname. If no text is selected, no characters are removed and Clear returns 0. If an error occurs, Clear returns -1.
If objectname is null, Clear returns null.
To select text for deleting, the user can use the mouse or keyboard. You can also call the SelectText function in a script.
To delete selected text and store it in the clipboard, use the Cut function.
If the text in sle_comment1 is Draft and it is selected, this statement clears Draft from sle_comment1 and returns 5:
sle_comment1.Clear()
If the text in sle_comment1 is Draft, the first statement selects the D and the second clears D from sle_comment1 and returns 1:
sle_comment1.SelectText(1,1)
sle_comment1.Clear()
Clears the contents of the control.
Signature controls
void controlname.Clear ( )
Argument |
Description |
---|---|
controlname |
The name of the signature control you want to clear |
None
This statement clears the contents of the signature control sig_1:
sig_1.clear()