[SOLVED] Create OSD lazarus / 31-LCL ---------------------------------------------------------------------- Pe3s · 2021-11-03 07:07 Hello, I am thinking about creating an OSD but I do not really know where to start.  The message or icon is to be displayed after pressing the button and hidden, e.g. for 2 seconds.  Any ideas how to do it. ---------------------------------------------------------------------- af0815 · 2021-11-03 09:05 Homework ?! Use a timer to close the message or icon by itself. ---------------------------------------------------------------------- Pe3s · 2021-11-03 10:30 yes homework.  with one element the matter is simple, worse with many ---------------------------------------------------------------------- af0815 · 2021-11-03 10:59 Have you a application (only source, no exe, no ppu,..) where we can see what you want to do ? With the description, i have no idea what you want. But with an source it can be more clearer. ---------------------------------------------------------------------- Pe3s · 2021-11-03 12:39 unfortunately I do not have the source code, I wanted to write this functionality, so I asked, if the question was stupid, I apologize ---------------------------------------------------------------------- Handoko · 2021-11-03 13:43 Try this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, ExtCtrls, StdCtrls; type   { TForm1 }   TForm1 = class(TForm)    Button1: TButton;    CheckBox1: TCheckBox;    Label1:  TLabel;    Label2:  TLabel;    Panel1:  TPanel;    Shape1:  TShape;  Timer1:  TTimer;    procedure Button1Click(Sender: TObject);    procedure CheckBox1Click(Sender: TObject);    procedure FormClick(Sender: TObject);    procedure FormCreate(Sender: TObject);    procedure Shape1MouseDown(Sender: TObject; Button: TMouseButton;    Shift: TShiftState; X, Y: Integer);    procedure Timer1Timer(Sender: TObject);  private    FWaitTime: Integer;    procedure DoPopup(const S: string);    procedure RefreshPopup;  end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.Timer1Timer(Sender: TObject);begin  Dec(FWaitTime);  RefreshPopup;end; procedure TForm1.Button1Click(Sender: TObject);begin  DoPopup('You''ve clicked the button.');end; procedure TForm1.CheckBox1Click(Sender: TObject);begin  DoPopup('You''ve clicked the checkbox.');end; procedure TForm1.FormClick(Sender: TObject);begin  FWaitTime := 0;  RefreshPopup;end; procedure TForm1.FormCreate(Sender: TObject);begin  Panel1.Visible   := False;  Panel1.Caption   := '';  Label1.Font.Size := 8;end; procedure TForm1.Shape1MouseDown(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);begin  DoPopup('You''ve clicked the rectangle.');end; procedure TForm1.DoPopup(const S: string);var  Y: Integer;begin  FWaitTime      := 5;  Label2.Caption := S;  Y            := ScreenToClient(Mouse.CursorPos).y + 20;  if Y > Height - Panel1.Height - 10 then    Y := Height - Panel1.Height - 10;  Panel1.Top     := Y;  Panel1.Visible := True;  Timer1.Enabled := True;  RefreshPopup;end; procedure TForm1.RefreshPopup;begin  if FWaitTime <= 0 then  begin    Timer1.Enabled := False;    Panel1.Visible := False;  end;  Label1.Caption :=    'Click outside the box to close it.' + LineEnding +    'Autoclose in ' + FWaitTime.ToString + ' second.';end; end. Only tested on Linux, it may look different on Windows. ---------------------------------------------------------------------- Pe3s · 2021-11-03 15:52 Thank you very much. Regards with a smile