Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incompatible types Tform and TCustomForm error

Status
Not open for further replies.

RandyBlackburn

Programmer
Oct 1, 2002
153
US
I'm trying to up-convert a delphi application to turbo delphi.

I'm using a control called TEnterEdit, which has the following code line:

Code:
MYForm := GetParentForm( Self )

I'm getting the Incompatible types Tform and TCustomForm error.

First, is a control like this to handle "entering" in fields still required in TurboDelphi?

2nd, if I still need it, is there a more modern contol, or how should I change the code?

Thanks in advance,
Randy
 
here's all the code:

Code:
procedure TEnterEdit.KeyPress(var Key: Char);
var
   MYForm: TForm;
begin

   if Key = #13 then
   begin
       MYForm := GetParentForm( Self );
       if not (MYForm = nil ) then
           SendMessage(MYForm.Handle, WM_NEXTDLGCTL, 0, 0);
       Key := #0;
   end;

   if Key <> #0 then inherited KeyPress(Key);

end;
 
OK, I changed the definition of MyForm to TCustomForm vice TForm, that compiles... but the other questions still apply

Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top