Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 3 of 3 total |
How to clear Event Method at run-time? |
Fri, Aug 12 2016 7:59 PM | Permanent Link |
Trinione | How can a components Event Method be set to nothing?
Basically, the opposite of assigning a method at run-time via the OnClick = OnClickHandler. OnClick := nil // does not work. |
Sat, Aug 13 2016 4:15 AM | Permanent Link |
Emin | Trinione,
They all work as expected. At what stage you are trying to set OnClick. May be you are doing it before the component loading stage so that your assignments are overridden. Emin Borbor procedure TForm1.NewHandlerForClick(Sender: TObject); begin ShowMessage('NewHandlerForClick', ''); end; procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage('Button1Click', ''); end; procedure TForm1.Button2Click(Sender: TObject); begin Button1.OnClick := nil; end; procedure TForm1.Button3Click(Sender: TObject); begin Button1.OnClick := NewHandlerForClick; end; |
Sat, Aug 13 2016 6:20 AM | Permanent Link |
Trinione | << They all work as expected. >>
Emin: Yes, it works. My error was I forgot to chamne the parameter of the function from a TControl to a TForm. As the event method (OnAnimationComplete) does not exist for a TControl the error occured. Thanks you, Trinione, |
This web page was last updated on Wednesday, April 24, 2024 at 11:07 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |