Click here to Skip to main content
15,914,014 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: std::sort( Ran first, Ran last, Cmp cmp) Pin
Paul Ranson10-May-04 10:39
Paul Ranson10-May-04 10:39 
GeneralRe: std::sort( Ran first, Ran last, Cmp cmp) Pin
Laing,James11-May-04 9:35
Laing,James11-May-04 9:35 
GeneralDialogs Pin
Member 6226669-May-04 10:51
Member 6226669-May-04 10:51 
GeneralRe: Dialogs Pin
Christian Graus9-May-04 13:03
protectorChristian Graus9-May-04 13:03 
Generalsnapping windows Pin
Roman Nurik9-May-04 9:19
Roman Nurik9-May-04 9:19 
GeneralRe: snapping windows Pin
KalliMan9-May-04 10:24
KalliMan9-May-04 10:24 
GeneralRe: snapping windows Pin
Antony M Kancidrowski10-May-04 2:01
Antony M Kancidrowski10-May-04 2:01 
GeneralSetFocus for a chosen Edit Control in MFC Pin
robert_s9-May-04 9:01
robert_s9-May-04 9:01 
Hi.

I am writing an application where I have a dialog with one combo box and 4 edit controls. Now when I open that dialog there is always first edit control focused. How can change this behaviour so for example rather than the first I would like the third edit control to be automatically focused, so when the user opens the dialog one can start typing into that (third) edit control rather than using a mouse to click on it first.

I thought it would be as simple as that:

BOOL CTestDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CtrlSourceExt.SetFocus(); // PROBLEM IS HERE - Set foucus to this edit control (this Doesn't work) (NOTE: variable CtrlSourceExt is of type CEdit)
UpdateData();
return TRUE; // return TRUE unless you set the focus to a control
}

Actually I remember in VC++ 6 I could specify the order of things to be focused in resource editor when designing a dialog. So if I had say 4 edit controls I could set focus in this order 4,2,1,3 so the first hightlighed edit control would be 4 then if the user pressed tab once it would take him to edit control 2 then 1 and 3. But now in VC++ 2003 .NET it doesnt work. Same thing with profiler I just cant find it. I dont know why they got rid of such useful thing. Anyway going back to the subject. Can anybody help?
Thanks.
GeneralRe: SetFocus for a chosen Edit Control in MFC Pin
KalliMan9-May-04 10:15
KalliMan9-May-04 10:15 
GeneralRe: SetFocus for a chosen Edit Control in MFC Pin
toxcct9-May-04 10:23
toxcct9-May-04 10:23 
GeneralRe: SetFocus for a chosen Edit Control in MFC Pin
robert_s9-May-04 12:07
robert_s9-May-04 12:07 
GeneralRe: SetFocus for a chosen Edit Control in MFC Pin
David Crow10-May-04 3:06
David Crow10-May-04 3:06 
Questioncd writer programming.how? Pin
Mohsen Saad9-May-04 8:59
Mohsen Saad9-May-04 8:59 
AnswerRe: cd writer programming.how? Pin
Anthony_Yio10-May-04 1:19
Anthony_Yio10-May-04 1:19 
GeneralDymanic windows Pin
Alton Williams9-May-04 4:44
Alton Williams9-May-04 4:44 
GeneralRe: Dymanic windows Pin
Jens Doose10-May-04 0:11
Jens Doose10-May-04 0:11 
GeneralDymanic windows (clarified) Pin
Alton Williams13-May-04 3:29
Alton Williams13-May-04 3:29 
GeneralRe: Dymanic windows (clarified) Pin
Jens Doose13-May-04 3:39
Jens Doose13-May-04 3:39 
GeneralRe: Dymanic windows (clarified) Pin
Alton Williams13-May-04 4:08
Alton Williams13-May-04 4:08 
GeneralRe: Dymanic windows (clarified) Pin
Jens Doose13-May-04 4:44
Jens Doose13-May-04 4:44 
GeneralRe: Dymanic windows Pin
David Crow10-May-04 3:07
David Crow10-May-04 3:07 
GeneralRe: Dymanic windows Pin
Alton Williams13-May-04 3:33
Alton Williams13-May-04 3:33 
GeneralRe: Dymanic windows Pin
marcosvpp10-May-04 5:54
marcosvpp10-May-04 5:54 
GeneralRe: Dymanic windows Pin
Jens Doose13-May-04 3:46
Jens Doose13-May-04 3:46 
GeneralRe: Dymanic windows Pin
Marcos Vinícius13-May-04 4:51
sussMarcos Vinícius13-May-04 4:51 

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.