Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

New Bug: No event handler when VCL Style is applied

Using latest IDE-Tools. 

When VCL Style is applied, double clicking on a TButton in TLMDDesignPanel does not generate a ModuleValidateEventHandlerName in the TLMDModule. However, when I double click on a button and no VCL Style is applied, ModuleGetEventHandlerName and ModuleValidateEventHandlerName are fired when I doulbe click on a TButton.

You can re-create this bug in the pIDE2 demo app.

Please fix. Thank you.


  • 2 Comments sorted by Votes Date Added
  • Posts: 0 Accepted Answer Vote Up0Vote Down
    The problem is in standard Delphi's TButtonStyleHook.WMLButtonDblClk method, which sets Handled parameter to True even in design-time. This way DElphi's styling system in incompatible with Delphi's designer system.
    As a workaround you can declare and register your own style hook class:

      TButtonExStyleHook = class(TButtonStyleHook)
        procedure WMLButtonDblClk(var Message: TWMMouse); message WM_LBUTTONDBLCLK;


    procedure TButtonExStyleHook.WMLButtonDblClk(var Message: TWMMouse);
      if not (csDesigning in Control.ComponentState) then


      TCustomStyleEngine.UnRegisterStyleHook(TButton, TButtonStyleHook);
      TCustomStyleEngine.RegisterStyleHook(TButton, TButtonExStyleHook);

    So, this effectively fixes the problem.
  • This works as a workaround. Thank you very much for looking into this and finding a solution! Great support!
Sign In or Register to comment.