Home > Back-end >  TButton does not identify the procedure written by hand delphi fmx
TButton does not identify the procedure written by hand delphi fmx

Time:12-19

I have a TButton on my Form, and I have a procedure that when clicking on this button executes a ShowMessage. Simple. The problem is that I 'erased' this procedure completely and then rewrote it perfectly as it was. The problem is then the button doesn't work anymore, nothing happens. If by chance I click 2x, it will direct a procedure written manually by me and then it works. I would like to know why?

(NOTE: I pasted in the 360 ​​code ​​procedures for 360 buttons in another delphi fmx project and I would not like to click on 360 buttons just for it to identify a procedure)

Thanks.

CodePudding user response:

Like Remy Lebeau said! Go to the events tab on the button, double click the onclick event, see if it will direct you to the procedure you have created! If it directs you to the procedure, but nothing happens, try to delete the procedure and everything related to it, then double click the onclick event and write the code again!

CodePudding user response:

You must change dfm file of your form for declaration of OnClick = Button1Click; One way is : Right click on form and select 'View as text' and add to base of form structure

object Form88: TForm88
  Left = 0
  Top = 0
  Caption = 'Form88'
     ...
     ...

  TextHeight = 15
  object Button1: TButton
    Left = 248
    ...
    ....
    OnClick = Button1Click
  end
end

Also, you can change dfm file by Editors and use find and replace for affect many change on the form suddenly.

  • Related