Code: Select all
METHOD PostFocus() CLASS Control
PostMessage( GetParent(SELF:Handle()) , WM_NextDlgCtl , DWORD( _CAST , SELF:Handle() ) , 1L )
IF IsInstanceOf(SELF,#SingleLineEdit)
PostMessage(SELF:Handle(), EM_SETSEL, 0, LONG(_CAST,SLen(RTrim(SELF:TextValue))))
PostMessage(SELF:Handle(), EM_SCROLLCARET, 0, 0L )
ELSEIF IsInstanceOf(SELF,#MultiLineEdit)
PostMessage(SELF:Handle(), EM_SETSEL, 0, 0L )
PostMessage(SELF:Handle(), EM_SCROLLCARET, 0, 0L )
ENDIF
RETURN NIL
Code: Select all
CLASS EditExtensions
METHOD PostFocus()
PostMessage( GetParent(SELF:Handle()) , WM_NextDlgCtl , DWORD( _CAST , SELF:Handle() ) , 1L )
IF IsInstanceOf(SELF,#SingleLineEdit)
PostMessage(SELF:Handle(), EM_SETSEL, 0, LONG(_CAST,SLen(RTrim(SELF:TextValue))))
PostMessage(SELF:Handle(), EM_SCROLLCARET, 0, 0L )
ELSEIF IsInstanceOf(SELF,#MultiLineEdit)
PostMessage(SELF:Handle(), EM_SETSEL, 0, 0L )
PostMessage(SELF:Handle(), EM_SCROLLCARET, 0, 0L )
ENDIF
RETURN NIL
END CLASS