Using Lazarus components

From Lazarus wiki
Revision as of 02:41, 15 March 2020 by Trev (talk | contribs) (Trev moved page Using components to Using Lazarus components without leaving a redirect: Clarified page content)
Jump to navigationJump to search

English (en)

Warning-icon.png

Warning: Tutorial under construction

Using components

Components vs Controls

While every control is a component, not every component is a control. Confused? Let's clear up the confusion: a control is a visual component that a user of your application can see on a form can interact with (control) using the keyboard and/or the mouse. For example, a TButton which you drop on a TForm is a visible component that a user can see and interact with using the keyboard and/or mouse. Visual components are typically user interface elements like buttons, labels, check boxes, radio buttons and dialogs.

On the other hand, there are components which have no visual control associated with them. For example, a TTimer which you drop on a TForm is a non-visual component. While you can see the TTimer at design time when you drop its icon on a form, there is nothing for the user to see or interact with at runtime.

What is a component?

A component is a Class - a module of code - typically comprising a data definition and a number of methods, which defines and describes a particular action or series of actions.

Lazarus components

Lazarus comes with a number of useful components on its Component Palette. A list of the components can be found here. There are also additional components which can be downloaded separately from the Lazarus Code and Component Repository.

Component properties

Comnponent methods

See also