Custom edit control

Im trying to create a custom edit control in Delphi 4. I have derived my new control from TCustomControl and i have a WM_KEYDOWN and a WM_CHAR message attach to my control. The problem is that i receive a message for all keys except from the Tab-key and the 4 caret navigation keys. How can i correct that in order to receive a message for those 5 keys as well.
LVL 1
ON031699Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nricoCommented:
Use OnKeyDown instead of OnKeyPress.
0
nricoCommented:
Oops... should have read the question better... :-)
0
lortegaCommented:
I'm not sure but maybe WM_KEYUP and WM_KEYDOWN will help you...

why don't derivate your component from TCustomEdit instead of TCustomControl?

good luck,
luis
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

LischkeCommented:
The reason why you don't get those keys is that you excplicitly have to tell that you want them:

type
  TMyControl = class(TCustomControl)
  private
    procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE;
  end;
procedure TMyControl.WMGetDlgCode(var Message: TWMGetDlgCode);

begin
  Message.Result := DLGC_WANTCHARS or DLGC_WANTARROWS or DLGC_WANTTAB;
end;


Ciao, Mike
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ON031699Author Commented:
Its working.....
Thanks for the help Lischke.
:)
0
LischkeCommented:
You are welcome...

Ciao, Mike

PS. Why did you give me only a B grading? Wasn't my answer perfect?
0
ON031699Author Commented:
I give a B grading if my question is answered. I will give an A grading if my question is answered and add some additional to the solution. I think there should be some room for the really good answers.
Hope you understand..... :)

Regards
ON
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.