Click here to Skip to main content
15,917,456 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: non-admin logins prevent program execution Pin
David Crow9-Aug-05 7:58
David Crow9-Aug-05 7:58 
QuestionPlease enter the path for vc60.pdb?? Pin
valerie999-Aug-05 7:33
valerie999-Aug-05 7:33 
AnswerRe: Please enter the path for vc60.pdb?? Pin
David Crow9-Aug-05 7:44
David Crow9-Aug-05 7:44 
GeneralRe: Please enter the path for vc60.pdb?? Pin
valerie999-Aug-05 7:57
valerie999-Aug-05 7:57 
GeneralRe: Please enter the path for vc60.pdb?? Pin
David Crow9-Aug-05 8:00
David Crow9-Aug-05 8:00 
GeneralRe: Please enter the path for vc60.pdb?? Pin
valerie999-Aug-05 8:11
valerie999-Aug-05 8:11 
GeneralProblem with bitmaps in XP Pin
djr_apd9-Aug-05 6:17
djr_apd9-Aug-05 6:17 
GeneralCButton disable/focus conundrum Pin
23_4449-Aug-05 6:09
23_4449-Aug-05 6:09 
I have two buttons on a form "Save" and "New". "New" is disabled. "Save" is enabled. When I click or press "Save" I want to enable "New", set the focus to it and then disable "Save"

OnSave(){
m_Save.EnableWindow(FALSE);
m_New.EnableWindow(TRUE);
m_New.SetFocus();
}

The problem is (tell me if I'm wrong) that the focus is still with the "Save" button until the function is over. So I get the focus rectangle to the "New" button but it doesn't function like it has the focus i.e. it is inoperable unless clicked (doesn't respond to a "enter key press"

So I then did the CCmdUI update processing (responds to flag) that would detect the proper flag and set the buttons state accordingly. It does do that but the focus is still trapped. The idle status processing must occur after the focus is set on the disabled button.

OnSave()
{
ModeStatus=PRISTINE;
//CmdUI will then set the state of the buttons accordingly

m_New.SetFocus();
}

I want to get the focus to the "New button so user doesn't have to take their hands off the keyboard to activate (i.e. the focus is on the proper button and they press the "enter" key).

Seems like I'm missing something simple. Any help would be appreciated.



GeneralRe: CButton disable/focus conundrum Pin
Ravi Bhavnani9-Aug-05 6:54
professionalRavi Bhavnani9-Aug-05 6:54 
GeneralRe: CButton disable/focus conundrum Pin
Blake Miller9-Aug-05 7:29
Blake Miller9-Aug-05 7:29 
GeneralRe: CButton disable/focus conundrum Pin
23_4449-Aug-05 7:33
23_4449-Aug-05 7:33 
GeneralRe: CButton disable/focus conundrum Pin
David Crow9-Aug-05 8:15
David Crow9-Aug-05 8:15 
GeneralRe: CButton disable/focus conundrum Pin
23_4449-Aug-05 8:23
23_4449-Aug-05 8:23 
GeneralRe: CButton disable/focus conundrum Pin
David Crow9-Aug-05 8:28
David Crow9-Aug-05 8:28 
GeneralRe: CButton disable/focus conundrum Pin
23_4449-Aug-05 8:55
23_4449-Aug-05 8:55 
GeneralRe: CButton disable/focus conundrum Pin
23_44410-Aug-05 7:46
23_44410-Aug-05 7:46 
GeneralRe: CButton disable/focus conundrum Pin
Blake Miller12-Aug-05 5:07
Blake Miller12-Aug-05 5:07 
Generalunwanted character on stringstream Pin
gecool9-Aug-05 4:36
gecool9-Aug-05 4:36 
GeneralRe: unwanted character on stringstream Pin
toxcct9-Aug-05 5:51
toxcct9-Aug-05 5:51 
GeneralRe: unwanted character on stringstream Pin
gecool9-Aug-05 20:26
gecool9-Aug-05 20:26 
GeneralRe: unwanted character on stringstream Pin
Eytukan9-Aug-05 6:02
Eytukan9-Aug-05 6:02 
QuestionTASPI? Pin
Eytukan9-Aug-05 3:39
Eytukan9-Aug-05 3:39 
AnswerTSAPI? Pin
Eytukan9-Aug-05 5:44
Eytukan9-Aug-05 5:44 
GeneralRe: TSAPI? Pin
16-Aug-05 4:00
suss16-Aug-05 4:00 
Generalmail project in vc++ (the connection can't be established) Pin
yasbakr9-Aug-05 2:20
yasbakr9-Aug-05 2:20 

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.