 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Pascal Guest
|
Posted: Sun Nov 16, 2003 10:16 am Post subject: How can I get Enter key first when there is a TButton.Defaul |
|
|
I put two controls on a form, one is TMyControl which is inherited from
TEdit, and the other is TButton which the property Default is set to TRUE.
For some reasons, I hope to disable the function of TButton.Default when I
press Enter key when TMyControl has the focus, how can I write the code in
TMyControl.
For example, if I put two controls, one is TCombobox and the other is
TButton which the property Default is set to TRUE. if now the FCombobox is
drop_down, even I press Enter key, it just make the FCombobox to close up,
and disable the Enter key to be sent to TButton (The FButton will not click
then). This is what I want. How to write the code in TMyControl to make
TMyControl can get the ENTER key first and disable it to be sent to TButton?
Thanks.
--Pascal
|
|
| Back to top |
|
 |
Kurt Barthelmess Guest
|
Posted: Sun Nov 16, 2003 11:05 am Post subject: Re: How can I get Enter key first when there is a TButton.De |
|
|
"Pascal" <dontreply (AT) openfind (DOT) com> wrote:
| Quote: | I put two controls on a form, one is TMyControl which is inherited from
TEdit, and the other is TButton which the property Default is set to TRUE.
For some reasons, I hope to disable the function of TButton.Default when I
press Enter key when TMyControl has the focus, how can I write the code in
TMyControl.
|
Respond to the WM_GETDLGCODE message. In there, call the inherited
method, and then "or" DLGC_WANTALLKEYS into the result.
Good luck.
Kurt
|
|
| Back to top |
|
 |
Pascal Guest
|
Posted: Sun Nov 16, 2003 11:58 am Post subject: Re: How can I get Enter key first when there is a TButton.De |
|
|
It works, Thanks.
"Kurt Barthelmess (TeamB)" <kbarthelmess (AT) compuserve (DOT) com> ¼¶¼g©ó¶l¥ó·s»D
:3fb75979.318117078 (AT) newsgroups (DOT) borland.com...
| Quote: | "Pascal" <dontreply (AT) openfind (DOT) com> wrote:
I put two controls on a form, one is TMyControl which is inherited from
TEdit, and the other is TButton which the property Default is set to
TRUE.
For some reasons, I hope to disable the function of TButton.Default when
I
press Enter key when TMyControl has the focus, how can I write the code
in
TMyControl.
Respond to the WM_GETDLGCODE message. In there, call the inherited
method, and then "or" DLGC_WANTALLKEYS into the result.
Good luck.
Kurt
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|