delphi - getting incompatible error while trying to assign a function to on click event -


When I click on the button I have a button, the type of caption will change.

  Type TForm1 = Class (TForm) Button 1: Tibbon; Functional Form (Sender: Tubect); Process set caption (sender: tubback); Private {Private Announcement} public {public declaration} end; Var Form 1: Teform 1; Implementation {$ R *. Dfm} {TForm1} Process TForm1.setcaption (Sender: Toubys); Start (the sender as tbutton). Parents as Tform Caption: = 'Successful ...'; End; Process TForm1.FormShow (Sender: TObject); Start button 1 Click: = Set Caption (Sender); End; [Error] Unit 1. (38): Incompatible type: 'TNotifyEvent' and 'Process, inherent indicator or unexpected parameter'  

Error getting

/ Code> < / Pre>

Please correct my mistake, I'm new to this concept ...

< P> You have to use the following:

  button. Click on 1: = setcaption;  

Please check the types on the left and right sides in your assignment statement. On the left is the type of type TNotifyEvent . This means that your expression should be of the same type in the right direction, for example: function returns the TNotifyEvent -typed value. Obviously, your process does not do this.

Recommended Reading:


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -