[SOLVED] How to open a popup form in linux which darkens the main window lazarus / 21-General ---------------------------------------------------------------------- Codrut1001 · 2023-11-24 14:39 How can you open a form modal dialog in Lazarus for linux that will gray out the parent window? Many Linux applications create such forms, and when you drag the child form, both forms will mode. Using, ShowMessage(), such a window will created, but I cannot figure out how I would do this with a TForm, or just a window which I can hide at any moment in time. The furthest I got was PromptDialogFunction(), which is what messagedlg and showmessage use. Here is an example: https://imgur.com/a/kO4pvTF Thanks in advance! ---------------------------------------------------------------------- Handoko · 2023-11-24 15:38 That can be achieved by darken the form before opening the child/modal form. So now the question is how to darken a form? To answer the new question, read here: https://forum.lazarus.freepascal.org/index.php/topic,42107.msg293272.h tml#msg293272 ---------------------------------------------------------------------- KodeZwerg · 2023-11-24 16:29 I was not aware of that thread but somehow did do same way 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, Graphics, Dialogs, StdCtrls, ExtCtrls; type   { TDark }   TDark = class(TForm)    public      constructor Create(const AForm: TForm; const AColor: TColor = clBlack;        const ABlending: Byte = 130); reintroduce;  end;   { TForm1 }   TForm1 = class(TForm)    Button1: TButton;    Panel1: TPanel;    procedure Button1Click(Sender: TObject);  private   public   end; var  Form1: TForm1; implementation {$R *.lfm} { TDark } constructor TDark.Create(const AForm: TForm; const AColor: TColor = clBlack;            const ABlending: Byte = 130);begin  inherited CreateNew(nil);  Self.Parent := nil;  Self.ShowInTaskBar := stNever;  Self.Visible := False;  Self.BorderIcons := AForm.BorderIcons;  Self.BorderStyle := AForm.BorderStyle;  Self.FormStyle := fsStayOnTop;  Self.Left := AForm.Left;  Self.Top := AForm.Top;  Self.Width := AForm.ClientWidth;  Self.Height := AForm.ClientHeight;  Self.Color := AColor;  Self.AlphaBlend := True;  Self.AlphaBlendValue := ABlending;  Self.Visible := True;end; { TForm1 } procedure TForm1.Button1Click(Sender: TObject);var  LDark: TDark;begin  LDark := TDark.Create(Self);  try    ShowMessage('Dark Test 123');  finally    LDark.Free;  end;end; end. ---------------------------------------------------------------------- Codrut1001 · 2023-11-24 17:15 I have just figured It out by accident while doing something else, all you have to do Is set the child forms BorderStyle property to bsDialog, and then use ShowModal to show the form. Also, the creating a black borderless form with a alpha blend value works on Windows and X11, but Linux Wayland does not support Alpha Blending for some reason. Thanks for the responses!