BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can I get Enter key first when there is a TButton.Defaul

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing
View previous topic :: View next topic  
Author Message
Pascal
Guest





PostPosted: Sun Nov 16, 2003 10:16 am    Post subject: How can I get Enter key first when there is a TButton.Defaul Reply with 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.

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





PostPosted: Sun Nov 16, 2003 11:05 am    Post subject: Re: How can I get Enter key first when there is a TButton.De Reply with quote



"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





PostPosted: Sun Nov 16, 2003 11:58 am    Post subject: Re: How can I get Enter key first when there is a TButton.De Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.