fire button when pressing enter in and edit box
-
hi, i have an edit box and a button add on a tab...im trying to have it where if a user press enter in the edit box it will execute the button add (call on the add function which the button is mapped to)..how can i do this? i've tried onchar event for that dialog and it's not detecting when i type in that edit box... one other thing, im using microsoft commondialog activex...how can i detect if the user press CANCEL or OK thanks alot for your help
-
hi, i have an edit box and a button add on a tab...im trying to have it where if a user press enter in the edit box it will execute the button add (call on the add function which the button is mapped to)..how can i do this? i've tried onchar event for that dialog and it's not detecting when i type in that edit box... one other thing, im using microsoft commondialog activex...how can i detect if the user press CANCEL or OK thanks alot for your help
Set the BS_DEFPUSHBUTTON style of the button.
MSN Messenger. prakashnadar@msn.com "If history isn't good, just burn it." - Sidhuism.
-
hi, i have an edit box and a button add on a tab...im trying to have it where if a user press enter in the edit box it will execute the button add (call on the add function which the button is mapped to)..how can i do this? i've tried onchar event for that dialog and it's not detecting when i type in that edit box... one other thing, im using microsoft commondialog activex...how can i detect if the user press CANCEL or OK thanks alot for your help
Make sure that the following propertty so not set for the edit box. ES_WANTRETURN Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multiple-line edit control in a dialog box. Without this style, pressing the ENTER key has the same effect as pressing the dialog box’s default pushbutton. This style has no effect on a single-line edit control I hope it helps
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
-
Make sure that the following propertty so not set for the edit box. ES_WANTRETURN Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multiple-line edit control in a dialog box. Without this style, pressing the ENTER key has the same effect as pressing the dialog box’s default pushbutton. This style has no effect on a single-line edit control I hope it helps
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
-
the default button is already set on and want return for the edit box is not checked, still same problem, any other suggestions? thanks
HI r00k13, i cant say for sure what is wrong but just try this. If it works, its gud 4 u. When u create a dialog box in the Dialog Editor, u r provided with two default buttons -OK & CNACEL. The proerty you are asking for is also present by default. (I have checked on my system, it is there even when u make a multiline edit box in the dialog). The OK button is clicked(OnIDOK() is called) when we press the "RETURN" key. It may be the case that you have deleted the default OK button and you have currently set a new button(that u hav created) as default. If it is so, change the ID if ur default Button from whatever it is currently, to IDOK. It may :cool: solve ur problem. Just giv it a try. Tell me if it works. ...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs