-
September 14th, 2001, 11:42 AM
#1
Rich Edit text always selected when page becomes active
I have a Property Sheet that contains four instances of a Property Page - which has a RichEdit Control, PushButton (Save) and a checkbox.
Problem is, whenever any Property Page is displayed, all of the text in the Richedit Control is always selected.
In the RichEdit control, I did not set NoHide. Nor do I call SetOptions() or HideSelection() within the code.
(Actually, I tried calling HideSelection() but it had no effect).
I also reset the selection by calling SetSel(0,1) at every possible place e.g. OnInitDialog(), OnSetActive().
So, is there a way to prevent the text in the control from always being Selected when the Page becomes Active?
Thanks,
Bryan.
-
September 14th, 2001, 11:48 AM
#2
Re: Rich Edit text always selected when page becomes active
I suspect that the rich edit control is first in the tab order, which is causing this behavior.
Create an OnSetFocus() handler for the control, and in that handler, use SetSel(-1,0).
-
September 14th, 2001, 12:14 PM
#3
Re: Rich Edit text always selected when page becomes active
Nope, that didn't get it.
I already had a handler for SetFocus, but changed the SetSel to (-1, 0) as you suggested.
I also added another Page ahead of the ones with RichEdit, but all of the RichEdit pages still have all of their text selected every time they become active.
Thanks,
Bryan.
-
September 14th, 2001, 02:30 PM
#4
Re: Rich Edit text always selected when page becomes active
FYI...
The answer lies in the Paint handler, for some reason when it is entered the RichEditCtrl is always set to select all of the text.
By resetting the selection in OnPaint, it will always come up as not-selected.
Thanks,
Bryan.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|