Groups > Borland > Delphi upgrade > Re: TForm.OnKeyDown




Re: TForm.OnKeyDown

Re: TForm.OnKeyDown
13 Nov 2007 10:06:49 -0700
Hubert Anemaat wrote:

> In some, not all, of my applications compiled in Delphi 2007, the
> TForm.OnKeyDown procedures do not work. In Delphi 6 I have no
> problem. In all forms the TForm.KeyPreview is set to True.  Is there
> another setting in Delphi 2007 to activate the OnKey procedures ?

Cant say Ive noticed any problems - got any examples?

-- 
Liz the Brit
Post Reply
Re: TForm.OnKeyDown
13 Nov 2007 11:22:18 -0700
Hubert Anemaat wrote:

> Hello,
> 
> In some, not all, of my applications compiled in Delphi 2007, the
> TForm.OnKeyDown procedures do not work. In Delphi 6 I have no
> problem. In all forms the TForm.KeyPreview is set to True.  Is there
> another setting in Delphi 2007 to activate the OnKey procedures ?
> 

Have you verified that the event handler is actually assigned to the
event in the OI? There have been some reports that the assignments can
get lost when you move a project to the newer Delphi version. Has not
happened in any of my projects, though.

-- 
Peter Below (TeamB)  
Don't be a vampire (http://slash7.com/pages/vampires), 
use the newsgroup archives :
http://www.tamaracka.com/search.htm
Post Reply
TForm.OnKeyDown
Tue, 13 Nov 2007 18:23:59 +010
Hello,

In some, not all, of my applications compiled in Delphi 2007, the 
TForm.OnKeyDown procedures do not work. In Delphi 6 I have no problem. 
In all forms the TForm.KeyPreview is set to True.
Is there another setting in Delphi 2007 to activate the OnKey procedures ?

Thanks,

Post Reply
Re: TForm.OnKeyDown
14 Nov 2007 11:11:59 -0700
Hubert Anemaat wrote:

> Hello,
> 
> I discovered the problem.
> I make use of inherited forms. The parent form TMyStdForm is derived
> from TForm and is a part of one of my packages.  In some of my
> applications this unit is not mentioned in the uses list of the .dpr.
> In that case the key procedures are not fired in the application. The
> source file .pas of TMyStdForm is not in the source path of the
> project. Only the compiled unit .dcu is in the library path.
> 
> It is strange that the behaviour of an application depends on the
> fact that a unit is mentioned in the unit list or not. This was not
> the case in Delphi 6.

Hm, but if the ancestor form is not part of the project you should get
errors from the IDE when you try to open a derived form, that happend
in every version of Delphi that supported visual form inheritance I can
remember. The IDE needs the ancestor forms DFM file.



-- 
Peter Below (TeamB)  
Don't be a vampire (http://slash7.com/pages/vampires), 
use the newsgroup archives :
http://www.tamaracka.com/search.htm
Post Reply
Re: TForm.OnKeyDown
Wed, 14 Nov 2007 13:51:28 +010
Hello Peter,

It is very strange. The first window in my applications is a database 
selector window. This window is used in all applications in a project. 
The Esc button in this window closes this window and selects the default 
database.
In 4 applications the button Esc works and in 2 applications this button 
does not work. In these 2 applications the keyboard key procedures are 
not fired in any window.
This is why I think it is somehow an application wide option in Delphi 2007.

Hubert Anemaat

Peter Below (TeamB) schreef:
> Hubert Anemaat wrote:
> 
>> Hello,
>>
>> In some, not all, of my applications compiled in Delphi 2007, the
>> TForm.OnKeyDown procedures do not work. In Delphi 6 I have no
>> problem. In all forms the TForm.KeyPreview is set to True.  Is there
>> another setting in Delphi 2007 to activate the OnKey procedures ?
>>
> 
> Have you verified that the event handler is actually assigned to the
> event in the OI? There have been some reports that the assignments can
> get lost when you move a project to the newer Delphi version. Has not
> happened in any of my projects, though.
Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact