The auto select text attribute of an edit field is a great
feature in the PowerBuilder Datawindow control when you are using it for
data entry. One thing that always bugged me was that the same attribute
was not available for edit mask controls. One solution to this is to add
a service to your datawindow that automatically checks for an edit mask
field and highlights the text. The following code is an example that
could be put in an itemfocuschanged event but should be added to a service
somewhere.
// IF there is a row present
IF Row > 0 THEN
IF Describe( dwo.Name + '.Edit.Style' ) = 'editmask' THEN
// Select the edit controls text
this.SelectText( 1, Len( String( &
GetItemString( row, dwo.Name ) ) ) )
END IF
END IF
|