THotKey does not work anymore under Delphi XE
Asked Answered
P

1

7

I have upgraded an old project from Delphi 7 to Delphi XE. The project has (among others) some THotKey controls. Under Delphi 7 the THotKey controls are working ok. But under Delphi XE they are like disabled. This means that they show nothing inside even if a shortcut (Alt+A for example) is assigned to them and I cannot edit them.

Anybody else has this issue?


Update:
I deleted ALL controls and all code from that project. Now I have ONLY the main form and a single THotKey control. Basically, after deleting all the controls my project is like a brand new created project without a single line of code. But the THotKey is still not working under Delphi XE and still works under D7.

Parotic answered 12/7, 2011 at 19:42 Comment(3)
"Basically, after deleting all the controls my project is like a brand new created project without a single line of code." I don't believe you. Create a new VCL project, and drop a THotKey onto the main form. Then it will work.Roxie
+1. You are completely right. Please, write an answer to this question yourself. This will make this question useful to others, and -- as a bonus -- you will get some 'free' rep for it!Roxie
However, of course -- you can have the form DoubleBuffered := true. The important thing is that the hot key control is not double buffered.Roxie
P
9

Cause found (Delphi bug)

I compared my project with a new created project. I have seen that the old form had the 'double buffering' option set while in the new project this was not on, so I manually turned off this option in my old form. Guess what? The THotKey works!!!!!!! Every time I turn the 'double buffering' on, the THotKey goes ape.

Confirmed
Yes (by Andreas Rejbrand)

Solution (partial):
I have seen that it is not actually main form's DoubleBuffered property that causes this but rather THotKey's. So it is enough to turn off this property for THotKey, not for entire form. I think I can leave with that.
:)

Parotic answered 12/7, 2011 at 19:57 Comment(3)
Yet again we find good cause not use use DoubleBuffered. You don't need to use it to get rid of flickering and it breaks your app.Burnley
Actually, I want to enable double buffering (to prevent flickering when I resize the form(s)).Parotic
It is possible to avoid flickering without double bufferingBurnley

© 2022 - 2024 — McMap. All rights reserved.