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

C / C++ / MFC

 
AnswerRe: How can I send a certain key to a certain application? (simulate keyboard) Pin
__Cerb27-Jan-04 14:35
__Cerb27-Jan-04 14:35 
GeneralRetrieve a user's email accounts Pin
LukeV27-Jan-04 12:11
LukeV27-Jan-04 12:11 
GeneralRe: Retrieve a user's email accounts Pin
David Crow27-Jan-04 13:41
David Crow27-Jan-04 13:41 
GeneralRe: Retrieve a user's email accounts Pin
Snyp27-Jan-04 14:49
Snyp27-Jan-04 14:49 
GeneralCPropertySheet - access Page variables Pin
john john mackey27-Jan-04 11:31
john john mackey27-Jan-04 11:31 
GeneralRe: CPropertySheet - access Page variables Pin
David Crow27-Jan-04 13:45
David Crow27-Jan-04 13:45 
GeneralRe: CPropertySheet - access Page variables Pin
john john mackey28-Jan-04 6:40
john john mackey28-Jan-04 6:40 
GeneralOverriding wizard setting focus to first field Pin
Christopher Duncan27-Jan-04 10:39
Christopher Duncan27-Jan-04 10:39 
Hey, folks.

All I wanted to do was...

I have a property page on a wizard, standard login with two edit controls, username and password. We default the username in some cases. The desired behavior is to set focus to the password if the username has text. Since we're in wizard mode, the user can back / next and hit this page multiple times, so calling SetFocus to the password field in OnInitDialog() would be insufficient.

So, naturally, I put it in OnSetActive(). Focus gets reset to username sometime after this function returns. Tried putting SetFocus in OnActivate(). Same results. Grepped the MFC code looking for SetFocus / SetCurSel calls. No dice. Burned incense. Sacrificed chickens. Still, the username (the first field in tab order), gets focus & text is highlighted whenever this page is displayed.

Anyone here fought this battle before? I'm running out of chickens, and nobody here likes my cooking anyway...

Thanks -

Christopher Duncan

Today's Corporate Battle Tactic
Unite the Tribes: Ending Turf Wars for Career and Business Success
The Career Programmer: Guerilla Tactics for an Imperfect World

GeneralRe: Overriding wizard setting focus to first field Pin
Jörgen Sigvardsson27-Jan-04 11:06
Jörgen Sigvardsson27-Jan-04 11:06 
GeneralRe: Overriding wizard setting focus to first field Pin
Christopher Duncan27-Jan-04 14:18
Christopher Duncan27-Jan-04 14:18 
GeneralRe: Overriding wizard setting focus to first field Pin
Ernesto D.27-Jan-04 16:10
Ernesto D.27-Jan-04 16:10 
GeneralRe: Overriding wizard setting focus to first field Pin
Christopher Duncan28-Jan-04 2:23
Christopher Duncan28-Jan-04 2:23 
Generalmy stupid MFC question of the day ... Pin
Maximilien27-Jan-04 10:33
Maximilien27-Jan-04 10:33 
Generalmy stupid MFC answer of the day ... Pin
Joaquín M López Muñoz27-Jan-04 11:13
Joaquín M López Muñoz27-Jan-04 11:13 
Generalmy first time programming Pin
jaapdeboer27-Jan-04 10:10
jaapdeboer27-Jan-04 10:10 
GeneralRe: my first time programming Pin
Mukkie27-Jan-04 10:13
Mukkie27-Jan-04 10:13 
GeneralRe: my first time programming Pin
Anonymous27-Jan-04 10:14
Anonymous27-Jan-04 10:14 
GeneralRe: my first time programming Pin
Carlos Antollini27-Jan-04 10:23
Carlos Antollini27-Jan-04 10:23 
GeneralRe: my first time programming Pin
Snyp27-Jan-04 12:04
Snyp27-Jan-04 12:04 
GeneralRe: my first time programming Pin
Anonymous27-Jan-04 16:19
Anonymous27-Jan-04 16:19 
GeneralAdd Controls to Dialog Programatically Pin
monrobot1327-Jan-04 8:41
monrobot1327-Jan-04 8:41 
GeneralRe: Add Controls to Dialog Programatically Pin
Mukkie27-Jan-04 8:44
Mukkie27-Jan-04 8:44 
GeneralRe: Add Controls to Dialog Programatically Pin
monrobot1327-Jan-04 8:57
monrobot1327-Jan-04 8:57 
GeneralRe: Add Controls to Dialog Programatically Pin
Mukkie27-Jan-04 9:07
Mukkie27-Jan-04 9:07 
GeneralRe: Add Controls to Dialog Programatically Pin
monrobot1327-Jan-04 10:04
monrobot1327-Jan-04 10:04 

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.