Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
LOCAL oGet
LOCAL cVar := "This is a test"
DEFINE DIALOG oDlg
@ 1, 1 GET oGet VAR cVar MEMO SIZE 100, 30
@ 3, 1 BUTTON "&Close" ACTION oDlg:End()
oDlg:bStart = { || oGet:SetSel( 2, 4 ) }
// oDlg:bStart = { || oGet:SetPos( 2, 4 ) }
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
Code: Select all
METHOD SetPos( nStart, nEnd ) INLINE ;
nEnd := If( nEnd == nil, nStart, nEnd ),;
::SendMsg( EM_SETSEL, nStart - If( nStart > 0, 0, 0 ), nEnd - If( nEnd > 0, 0, 0 ) ),;
::nPos := nStart
EMG