lisa_mc
asked on
Form Focus
I am using C++ builder 6.0 and windows XP
I have a form with numerous edit boxes when the user inputs information to the edit box then presses X (i have used the keypress method of the edit box) I want to give focus to the form so that when the user presses X again something else will happen.
void __fastcall Tentermeters1form::MaskEdi t1KeyPress (TObject *Sender,
char &Key)
{
if (Key == 'X') // if user presses X the program will show the totals on the screen
{
//DO OTHER CLACULATIONS HERE
entermeters1form->SetFocus ();
}// end if Key == X
}
after all the calculations are done I want the form to receive focus but the above code doesnt work could anyone explain why?
I have a form with numerous edit boxes when the user inputs information to the edit box then presses X (i have used the keypress method of the edit box) I want to give focus to the form so that when the user presses X again something else will happen.
void __fastcall Tentermeters1form::MaskEdi
char &Key)
{
if (Key == 'X') // if user presses X the program will show the totals on the screen
{
//DO OTHER CLACULATIONS HERE
entermeters1form->SetFocus
}// end if Key == X
}
after all the calculations are done I want the form to receive focus but the above code doesnt work could anyone explain why?
I noticed that you are testing 'X", are you pressing a lower case 'x' instead of an upper case one?
ASKER
No i am def pressing uppercase X because I have a mask over the edit box which only accepts numbers so when the user presses anything other than X and a number the program doesnt do anything
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks guys got it sorted have accepted both solutions