Copie du wikimiroir

Ceci est un miroir du wiki de pascal.chat. La modification, l’historique et la connexion se trouvent là-bas.

TScrollBar/fr

Deutsch · English · Français · Suomi · 日本語

Un TScrollBar est un contrôle qui permet à l'utilisateur de défiler le contenu d'un contrôle associé en déplaçant un curseur (slider).

Usage

Pour utiliser un TScrollBar sur une fiche, vous pouvez simplement le sélectionner sur l'onglet Standard de la palette de composants et le placer en cliquant sur la fiche.

Petit exemple

Déplacez sur image sur votre fiche selon les positions du ScrollBar.

pascal
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
  ImageList1.Draw(
    Paintbox1.Canvas,
    sbHori.Position * (PaintBox1.ClientWidth  - ImageList1.Width)  div sbHori.Max,
    sbVert.Position * (Paintbox1.ClientHeight - ImageList1.Height) div sbVert.Max,
    0);
end;
pascal
procedure TForm1.sbVertChange(Sender: TObject);
begin
  RePaint;
end;

Votre petit programme pourrait ressembler à ceci :

Voir aussi


From the Free Pascal wiki, page "TScrollBar/fr", as it stood on 2020-03-01 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Version 1, dernière modification par WikiArchive .