Click here to Skip to main content
15,919,774 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CVS Pin
Victor Boctor22-Dec-02 13:11
Victor Boctor22-Dec-02 13:11 
GeneralClose pop-up menu Pin
comrade22-Dec-02 4:48
comrade22-Dec-02 4:48 
GeneralRe: Close pop-up menu Pin
Gary R. Wheeler22-Dec-02 5:09
Gary R. Wheeler22-Dec-02 5:09 
GeneralMoving Cursor position in Edit box ! Pin
Hadi Rezaee22-Dec-02 2:03
Hadi Rezaee22-Dec-02 2:03 
GeneralRe: Moving Cursor position in Edit box ! Pin
Stan Shannon22-Dec-02 2:42
Stan Shannon22-Dec-02 2:42 
GeneralRe: Moving Cursor position in Edit box ! Pin
Stan Shannon22-Dec-02 2:55
Stan Shannon22-Dec-02 2:55 
GeneralRe: Moving Cursor position in Edit box ! Pin
Brian Delahunty22-Dec-02 3:09
Brian Delahunty22-Dec-02 3:09 
GeneralRe: Moving Cursor position in Edit box ! Pin
Andreas Masur22-Dec-02 9:05
Andreas Masur22-Dec-02 9:05 
void CEdit::SetSel(DWORD dwSelection, BOOL bNoScroll = FALSE);
void CEdit::SetSel(int nStartChar, int nEndChar, BOOL bNoScroll = FALSE);

To set the cursor at the end of the text within the control...
// With associated member variable to the edit control and to the content
UpdateData();
m_EditControl.SetSel(m_EditContent.GetLength(), m_EditContent.GetLength());


// With associated member variable to the content
UpdateData();
((CEdit *) GetDlgItem(IDC_EDIT))->SetSel(m_EditContent.GetLength(), m_EditContent.GetLength());

If you want to use the first function you have to set the starting position in the low-order word and and the ending position in the high-order word...thus
// With associated member variable to the edit control and to the content
UpdateData();

// Set position
DWORD dwSelection = m_EditContent.GetLength();
dwSelection |= m_EditContent.GetLength() << 16;

m_EditControl.SetSel(dwSelection);


// With associated member variable to the content
UpdateData();

// Set position
DWORD dwSelection = m_EditContent.GetLength();
dwSelection |= m_EditContent.GetLength() << 16;

((CEdit *) GetDlgItem(IDC_EDIT))->SetSel(dwSelection);


Ciao, Andreas

"Software is like sex, it's better when it's free." - Linus Torvalds
GeneralAccess violation happend Pin
Mazdak22-Dec-02 0:53
Mazdak22-Dec-02 0:53 
GeneralRe: Access violation happend Pin
Stan Shannon22-Dec-02 2:34
Stan Shannon22-Dec-02 2:34 
GeneralInformation extraction from website Pin
georgiek5022-Dec-02 0:29
georgiek5022-Dec-02 0:29 
GeneralRe: Information extraction from website Pin
Chris Losinger22-Dec-02 14:56
professionalChris Losinger22-Dec-02 14:56 
GeneralRe: Information extraction from website Pin
georgiek5022-Dec-02 15:23
georgiek5022-Dec-02 15:23 
GeneralRe: Information extraction from website Pin
Chris Losinger22-Dec-02 15:37
professionalChris Losinger22-Dec-02 15:37 
GeneralRe: Information extraction from website Pin
georgiek5022-Dec-02 23:54
georgiek5022-Dec-02 23:54 
GeneralRe: Information extraction from website Pin
Scott H. Settlemier23-Dec-02 5:06
Scott H. Settlemier23-Dec-02 5:06 
GeneralRe: Information extraction from website Pin
georgiek5023-Dec-02 6:53
georgiek5023-Dec-02 6:53 
GeneralRe: Information extraction from website Pin
Scott H. Settlemier23-Dec-02 7:46
Scott H. Settlemier23-Dec-02 7:46 
GeneralRe: Information extraction from website Pin
georgiek5023-Dec-02 8:29
georgiek5023-Dec-02 8:29 
GeneralRe: Information extraction from website Pin
Scott H. Settlemier23-Dec-02 8:51
Scott H. Settlemier23-Dec-02 8:51 
GeneralRe: Information extraction from website Pin
georgiek5023-Dec-02 12:23
georgiek5023-Dec-02 12:23 
Generallinking problem Pin
Luke Murray22-Dec-02 0:19
Luke Murray22-Dec-02 0:19 
GeneralRe: linking problem Pin
Mike Nordell22-Dec-02 0:32
Mike Nordell22-Dec-02 0:32 
GeneralRe: linking problem Pin
Luke Murray22-Dec-02 0:51
Luke Murray22-Dec-02 0:51 
GeneralRe: linking problem Pin
Michael Dunn22-Dec-02 5:37
sitebuilderMichael Dunn22-Dec-02 5:37 

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.