[Answered] Any "windowed" TLabel? lazarus / 31-LCL ---------------------------------------------------------------------- devEric69 · 2021-09-21 12:25 Hello, In Delphi, there is \ was - from memory - a "windowed" TLabel with its THandle. So, the characteristic of such a control, is that it allows to select at runtime the caption-text with the mouse, like in a read- only TEdit. Is there a similar component in Lazarus\LCL or in a third- party package (AFAIK, the basic TLabel doesn't allow a runtime selection of its displayed caption-text). Regards. ---------------------------------------------------------------------- AlexTP · 2021-09-21 13:06 https://wiki.freepascal.org/TStaticText Not sure it supports the selection. ---------------------------------------------------------------------- devEric69 · 2021-09-21 13:26 Quote from: Alextp on September 21, 2021, 03:06:09 pmNot sure it supports the selection. Thanks @Alextp. Indeed, it's a descendant of TWinControl. So, the equivalent of what I've described. However, at runtime, under Linux + LCLWidgesetType=gtk2, I cannot select it, in order to highlight the TStaticText's caption-text and to copy it inside the clipboard (did I miss anything?). ==> does anyone know such a TLabel visual control that allows this? ---------------------------------------------------------------------- Zvoni · 2021-09-21 13:41 Why not just use a TEdit with ReadOnly = True ? ---------------------------------------------------------------------- devEric69 · 2021-09-21 13:51 Well, that's what I'm doing at the moment (TEdit, with no border, and read-only mode). Now, I've this souvenir in Delphi. Hence my question (curiosity). ---------------------------------------------------------------------- Remy Lebeau · 2021-09-21 18:46 Quote from: devEric69 on September 21, 2021, 03:51:42 pmNow, I've this souvenir in Delphi. Hence my question (curiosity). AFAIK, TStaticText in Delphi doesn't support selections, either.  It is just a thin wrapper around a Win32 STATIC control, which MSDN says: About Static Controls QuoteAlthough static controls are child windows, they cannot be selected. ---------------------------------------------------------------------- devEric69 · 2021-09-22 07:28 Hello @Remy Lebeau, Thank you for these technical precisions emanating from MS-Windows itself. Indeed, there doesn't seem to be a ready-made selectable label in Delphi (bad memory, sorry). On the other hand, it seems not very complicated to automate the copy- paste of the caption inside the clipboard: 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 type  TcopyingLabel = class(TLabel)    private    protected        procedure Click; override;    public    published  end; procedure Register; implementation uses Clipbrd; procedure Register;begin     RegisterComponents('Standard', [TcopyingLabel]);end; procedure TcopyingLabel.Click;begin     Clipboard.AsText:= Self.Caption;     { behaviorial click of inherited parent }     inherited Click;end;