Click here to Skip to main content
15,892,674 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: recording mouse and keyboard events Pin
Nibu babu thomas16-May-06 17:48
Nibu babu thomas16-May-06 17:48 
QuestionInputting a dialog resource into a CFormView Pin
DanYELL16-May-06 16:27
DanYELL16-May-06 16:27 
AnswerRe: Inputting a dialog resource into a CFormView Pin
Nibu babu thomas16-May-06 17:39
Nibu babu thomas16-May-06 17:39 
QuestionPossible? to remotele command an IE window to load a page? Pin
Peter Weyzen16-May-06 14:08
Peter Weyzen16-May-06 14:08 
AnswerRe: Possible? to remotele command an IE window to load a page? Pin
Stephen Hewitt16-May-06 15:00
Stephen Hewitt16-May-06 15:00 
GeneralRe: Possible? to remotele command an IE window to load a page? Pin
Peter Weyzen16-May-06 17:30
Peter Weyzen16-May-06 17:30 
QuestionHow to register directshow filter? Pin
yongwpi16-May-06 10:16
yongwpi16-May-06 10:16 
QuestionCEdit SetSel and Scrolling Pin
Thomas Blenkers16-May-06 9:14
Thomas Blenkers16-May-06 9:14 
Hello everyone,

this is a sounds-so-simple gray hair maker. Please help out:

A single line edit control on my dialog contains So far nothing complicated. Now:

On an event I would like to add some long text at the cursor position, give the edit box the focus, select the whole text of the edit control ***AND** I would like to see the beginning of my long selected text ...

CEdit *pEdit = (CEdit *)GetDlgItem(IDC_EDIT1);

pEdit->ReplaceSel("This is some long and rather useless test text");
pEdit->SetSel(0, -1);
pEdit->SetFocus();

The problem is that the SetSel scrolls the edit box to the end of the selection. Is there a way to scroll to the beginning without loosing the selection?

If you know the length of the selection, you may do both .SetSel(Start, End) or .SetSel(End, Start) but always the caret and the scroll will be at the end of the selection.

WM_HELP

Thomas
AnswerRe: CEdit SetSel and Scrolling Pin
Nibu babu thomas16-May-06 17:19
Nibu babu thomas16-May-06 17:19 
GeneralRe: CEdit SetSel and Scrolling Pin
Thomas Blenkers17-May-06 9:06
Thomas Blenkers17-May-06 9:06 
GeneralRe: CEdit SetSel and Scrolling Pin
Nibu babu thomas17-May-06 17:22
Nibu babu thomas17-May-06 17:22 
GeneralRe: CEdit SetSel and Scrolling Pin
Thomas Blenkers20-May-06 7:19
Thomas Blenkers20-May-06 7:19 
GeneralRe: CEdit SetSel and Scrolling Pin
Nibu babu thomas21-May-06 17:48
Nibu babu thomas21-May-06 17:48 
QuestionOLE Automation and MS Outlook. Pin
Chris Meech16-May-06 8:41
Chris Meech16-May-06 8:41 
AnswerRe: OLE Automation and MS Outlook. Pin
Steve Echols16-May-06 18:45
Steve Echols16-May-06 18:45 
GeneralRe: OLE Automation and MS Outlook. Pin
Chris Meech17-May-06 2:53
Chris Meech17-May-06 2:53 
GeneralRe: OLE Automation and MS Outlook. Pin
Chris Meech17-May-06 3:26
Chris Meech17-May-06 3:26 
QuestionNeed Help with CMainFrame and VS 7.0 Pin
Jethro6316-May-06 8:15
Jethro6316-May-06 8:15 
AnswerRe: Need Help with CMainFrame and VS 7.0 Pin
led mike16-May-06 8:50
led mike16-May-06 8:50 
GeneralRe: Need Help with CMainFrame and VS 7.0 Pin
Jethro6316-May-06 8:55
Jethro6316-May-06 8:55 
GeneralRe: Need Help with CMainFrame and VS 7.0 Pin
led mike16-May-06 8:59
led mike16-May-06 8:59 
QuestionCommand line parameters[modified] Pin
ddmcr16-May-06 7:53
ddmcr16-May-06 7:53 
QuestionRe: Command line parameters Pin
David Crow16-May-06 8:39
David Crow16-May-06 8:39 
AnswerMessage Closed Pin
16-May-06 8:49
ddmcr16-May-06 8:49 
GeneralRe: Command line parameters Pin
David Crow16-May-06 8:58
David Crow16-May-06 8:58 

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.