|
-
May 6th, 1999, 04:03 PM
#1
I need to tab to next CEdit using the <ENTER> key instead of the <TAB> key . . .
appreciate any s****. Thanks. JD
-
May 6th, 1999, 04:35 PM
#2
Re: I need to tab to next CEdit using the <ENTER> key instead of the <TAB> key . . .
Try trapping the OnChar call. if the enter key is set handle as you need.
Else just pass on to the parent class. THis does require a derived class.
void CMabEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if(nChar==13)
{
OnKillfocus();
return;
}
CEdit::OnChar(nChar, nRepCnt, nFlags);
}
-
May 6th, 1999, 05:44 PM
#3
Re: I need to tab to next CEdit using the <ENTER> key instead of the <TAB> key . . .
See Example 5 on my web site at http://home.earthlink.net/~railro/mfc_link.html
Rail
Recording Engineer/Software Developer
Rail Jon Rogut Software
[email protected]
http://home.earthlink.net/~railro/
-
May 6th, 1999, 10:26 PM
#4
Re: I need to tab to next CEdit using the <ENTER> key instead of the <TAB> key . . .
OK, try this (its a little bit "dirty" but fast, easy and works anytime)
- Put a button on your dialog.
- make it the default button (now it catches the enter key)
- hide this button
- create the OnButton...() method via class wizard
- enter a code like this (i think "OnKillFocus()" as mentioned in another post should not be called directly):
--------
void CKostenEditDlg::OnButtonReturn()
{
CWnd* pCurrentItem = GetFocus();
// if (pCurrentItem == &m_ctrlUmlage)
// OnDblclkUmlage();
// else {
CWnd* pNextItem = GetNextDlgTabItem( pCurrentItem );
pNextItem->SetFocus();
if ( pNextItem->IsKindOf( RUNTIME_CLASS( CEdit )) )
((CEdit*)pNextItem)->SetSel(0, -1);
// }
}
--------
you don't need the code I have commented, that part I used to catch the enter key on a CListCtrl (m_ctrlUmlage) and call the onDoubleClck()-method for that control ....
-
May 7th, 1999, 11:40 AM
#5
-
May 7th, 1999, 11:44 AM
#6
Rail, your page is terrific! Now how do I capture the ENTER key for a CComboBox . . .
I derived MyComboBox & thought I captured the WM_CHAR, . . . but apparently not since the function is never called. Should I just use a list box with my own CEdit . . would that be the easiest way? Sure appreciate your help! JD
-
May 7th, 1999, 11:46 AM
#7
-
May 8th, 1999, 08:38 AM
#8
To Rail only . .
Tried to email you . . undeliverable (?), anyway,
Rail, could you please point me to what I need to read or tools available to
learn to create a web page & others would be able to download programs from
the site. (like yours) Thanks very much for any suggestions you might be
able to provide. My email is [email protected]
Thanks, John
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
|