Click here to Skip to main content
16,005,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSet Cursor EOL in CEdit box? Pin
Robert Palma Jr.30-Dec-01 8:02
Robert Palma Jr.30-Dec-01 8:02 
AnswerRe: Set Cursor EOL in CEdit box? Pin
567890123430-Dec-01 21:27
567890123430-Dec-01 21:27 
GeneralRe: Set Cursor EOL in CEdit box? Pin
Robert Palma Jr.31-Dec-01 11:13
Robert Palma Jr.31-Dec-01 11:13 
GeneralRe: Set Cursor EOL in CEdit box? Pin
567890123431-Dec-01 19:50
567890123431-Dec-01 19:50 
GeneralRe: Set Cursor EOL in CEdit box? Pin
Robert Palma Jr.2-Jan-02 8:31
Robert Palma Jr.2-Jan-02 8:31 
GeneralRe: Set Cursor EOL in CEdit box? Pin
56789012342-Jan-02 19:29
56789012342-Jan-02 19:29 
GeneralRe: Set Cursor EOL in CEdit box? Pin
Robert Palma Jr.4-Jan-02 11:34
Robert Palma Jr.4-Jan-02 11:34 
GeneralRe: Set Cursor EOL in CEdit box? Pin
Fredrik Skog1-Jan-02 22:15
Fredrik Skog1-Jan-02 22:15 
Hi Robert!

I have encountered the same problem, specifically when subclassing the control.
See this thread.
SetWindowText() does not work well for me,
so I resorted to using ReplaceSel() instead.

To move the caret to the end, try:
mc_editkey.SetSel(0, -1);
mc_editkey.SetSel(-1, -1);

Now, use ReplaceSel to append text:
ReplaceSel(buf);

In your case, I think it might be enough with ReplaceSel(), since it should move the caret to the end.

There is no need to use UpdateData(), it will work anyway.
Do you return FALSE from OnInitDialog()? You must do that when setting the focus on a control. See CDialog::OnInitDialog in MSDN.

Cheers,

/Fredrik

Do you Sonork? I do! 100.11430 PhatBoy
GeneralRe: Set Cursor EOL in CEdit box? Pin
Robert Palma Jr.2-Jan-02 8:34
Robert Palma Jr.2-Jan-02 8:34 
GeneralPC CLOCK Pin
meirav30-Dec-01 7:41
meirav30-Dec-01 7:41 
GeneralRe: PC CLOCK Pin
Matt Newman30-Dec-01 8:20
Matt Newman30-Dec-01 8:20 
GeneralDetecting MDAC Version in Code Pin
John Clump30-Dec-01 6:50
John Clump30-Dec-01 6:50 
GeneralRe: Detecting MDAC Version in Code Pin
Rashid Thadha31-Dec-01 4:44
Rashid Thadha31-Dec-01 4:44 
GeneralZipping Question Pin
Ever123430-Dec-01 6:21
Ever123430-Dec-01 6:21 
GeneralRe: Zipping Question Pin
Joaquín M López Muñoz30-Dec-01 6:51
Joaquín M López Muñoz30-Dec-01 6:51 
GeneralRe: Zipping Question Pin
PJ Arends30-Dec-01 8:38
professionalPJ Arends30-Dec-01 8:38 
GeneralRe: Zipping Question Pin
Ever123430-Dec-01 10:32
Ever123430-Dec-01 10:32 
GeneralCrystal Report question ... Pin
Hadi Rezaee29-Dec-01 23:32
Hadi Rezaee29-Dec-01 23:32 
GeneralRe: Crystal Report question ... Pin
Hadi Rezaee30-Dec-01 9:13
Hadi Rezaee30-Dec-01 9:13 
GeneralWM_CHAR Pin
29-Dec-01 18:24
suss29-Dec-01 18:24 
GeneralRe: WM_CHAR Pin
Christian Graus29-Dec-01 23:06
protectorChristian Graus29-Dec-01 23:06 
QuestionHow to change the default Formcolor in MDI application? Pin
anju29-Dec-01 18:15
anju29-Dec-01 18:15 
AnswerRe: How to change the default Formcolor in MDI application? Pin
Christian Graus29-Dec-01 23:07
protectorChristian Graus29-Dec-01 23:07 
GeneralCDaoRecordset query question Pin
Wolfram Steinke29-Dec-01 14:49
Wolfram Steinke29-Dec-01 14:49 
Generalerror Pin
Rickard Andersson2029-Dec-01 10:15
Rickard Andersson2029-Dec-01 10:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.