Calling Methods

From RAD Studio
Jump to: navigation, search

Go Up to Working with Components Index

Methods are called just like ordinary procedures and functions. For example, visual controls have a Repaint method that refreshes the control's image on the screen. You could call the Repaint method in a draw-grid object like this:


As with properties, the scope of a method name determines the need for qualifiers. If you want, for example, to repaint a form within an event handler of one of the form's child controls, you don't have to prepend the name of the form to the method call:

 procedure TForm1.Button1Click(Sender: TObject);
void __fastcall TFrom1::Button1Click(TObject *Sender)

For more information about scope, see Scope and Qualifiers.

See Also