Re: CEdit, set cursor position
From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 09/02/04
- Next message: Tom Serface: "Re: Please Help! Delete/ADD list control"
- Previous message: Jim Carlock: "Re: DOS applications ?"
- In reply to: Jon Evans: "CEdit, set cursor position"
- Next in thread: Jon Evans: "Re: CEdit, set cursor position"
- Reply: Jon Evans: "Re: CEdit, set cursor position"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 02 Sep 2004 12:22:39 -0400
If the selection start and end are the same, you see no selection, you just get the caret.
Set the selection in the OnSetActive handler. You also need to set the focus first.
joe
On Thu, 2 Sep 2004 07:19:09 -0700, Jon Evans <JonEvans@discussions.microsoft.com> wrote:
>How do you set the cursor position in a CEdit control ?
>
>Reading back through previous threads seems to indicate
>that you somehow use CEdit's SetSel(). Can anyone tell me
>what parameters to pass ? I want the cursor to be at the right
>of any text and with no text highlighted.
>
>If I have just used CEdit's SetWindowText() and then
>called SetSel(1000,1000) (1000 being much greater
>than text length) then this appears to work.
>
>However the CEdit resides on a property page used as
>a wizard, and I'm finding it impossible to control the CEdit
>when people arrive on the page from another page's 'back'
>or 'next' button. I can get the cursor to the end of the text
>but the blasted text is still highlighted :-(
>
>Before I completely loose the plot and try sending virtual
>right key presses to the control, can anyone suggest how
>to do it properly ?
>
>TTFN,
> Jon
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
- Next message: Tom Serface: "Re: Please Help! Delete/ADD list control"
- Previous message: Jim Carlock: "Re: DOS applications ?"
- In reply to: Jon Evans: "CEdit, set cursor position"
- Next in thread: Jon Evans: "Re: CEdit, set cursor position"
- Reply: Jon Evans: "Re: CEdit, set cursor position"
- Messages sorted by: [ date ] [ thread ]