ObjectDCL Banner

TextBox_SetFilter Method

Description

This method retrieves the filter string used by a TextBox control to filter the text entered by the user.

For example a setting of "0123456789" for the FilterStringCollection argument will tell the TextBox to only accept keyboard keys of that are in the string.

Parameters

MyControlReference
Reference to the control in the form of MyProject_MyForm_MyControl.
ProjectFile
String identifying the project as it was passed in LoadProject.
DialogName
String identifying the dialog by name.
ControlName
String identifying the control by name.
FilterStringCollection
String specifying the filter to apply.

Return Values

Returns the following according to the situation:

  • T when successful.
  • Nil if the control is not found or is not visible.

AutoLISP Syntax

The recommended convention is passing the control identifier directly:

CopyCode imageCopy Code
(Odcl_TextBox_SetFilter 
		MyControlReference [as Reference]
		FilterStringCollection [as String])

An alternative convention is to identify the control by providing the project file, the dialog name and the control name:

CopyCode imageCopy Code
(Odcl_TextBox_SetFilter
		ProjectFile [as String]
		DialogName [as String]
		ControlName [as String]
		FilterStringCollection [as String])

Applies For

TextBox.

Example

CopyCode imageCopy Code
; Set a new filter
(Odcl_TextBox_SetFilter MyProject_MyForm_MyControl "0123456789")

See Also

TextBox_GetFilter