
Need to control when a control gets the focus on a dialog
What Ajay took as an assumption was that you know how to
subclass...his answer is correct, but if you've not done this before
it might be confusing to you. What you do is go to the ClassWizard,
create a new class, give its base class as CRichEditCtrl, and then
create in that subclass a WM_SETFOCUS handler. Then you have to make
sure you have a control variable for your rich edit class in the
parent dialog; you can read my essay on Avoiding GetDlgItem for how to
do this. If you already have such a variable, just change its type
from CRichEditCtrl to CMyRichEditCtrl (or whatever you called your
class) and you are done.
joe
Quote:
>I have not used Rich Edit Control but you can override OnSetFocus and not
>call the base class for default behavior. Simply put the cursor whereever
>you want and exit the function.
Joseph M. Newcomer [MVP]
Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm