Has anyone found a way to have memo edit default to selectnone or unselect text during ON INIT?
I have tried many different ways to get the memo edit not to select all automatically.
This has caused more than 1 person to accidentally erase memo with keystroke.
How to make memo edit in dialog automatic selectnone?
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: How to make memo edit in dialog automatic selectnone?
Gale
Insert this code after your memo get statement .. what this code does is move the cursor to the first character and unselects All..
Rick Lipkin
Insert this code after your memo get statement .. what this code does is move the cursor to the first character and unselects All..
Rick Lipkin
Code: Select all
oMemo:bGotFocus = { || oMemo:SetSel( 0, 0 ),;
oMemo:Goto( oMemo:GetLineCount() ),;
__Keyboard( Chr( VK_END ) ) }
Re: How to make memo edit in dialog automatic selectnone?
Thanks,
This line was enough for my purposes.
oGet1:bGotFocus = { || oGet1:SetSel( 0, 0 ) }
This line was enough for my purposes.
oGet1:bGotFocus = { || oGet1:SetSel( 0, 0 ) }
Re: How to make memo edit in dialog automatic selectnone?
Another problem: I can not switch between insert and overwrite. (is always insert) but the cursortype is overwrite.
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: How to make memo edit in dialog automatic selectnone?
Günther
I place this at the top of my Main program :
This globally sets all fields to insert rather to overstrike .. a bit clumsy, but it works.
Rick Lipkin
I place this at the top of my Main program :
Code: Select all
// replaces overstrike in gets
Set( _SET_INSERT, .t. )
TGet():lChangeCaret := .f.
Rick Lipkin
Re: How to make memo edit in dialog automatic selectnone?
Thanks Rick!
This is right code. After leaving the multiget i change to old mode. I have also tested with ::gotfocus and ::lostfocus to Change the caret.
Antonio, as the multiget cannot switch off the insert-mode, the caret should be always shown as block on this control.
Code: Select all
local lSet := Set( _SET_INSERT)
Set( _SET_INSERT, .t. )
TMultiGet():lChangeCaret := .t.
....
@ 1,1 redefine oMulti MULTIGET....
....
Set( _SET_INSERT, lSet)
Antonio, as the multiget cannot switch off the insert-mode, the caret should be always shown as block on this control.