Recent

Author Topic: Labels the user can select and copy text from  (Read 3068 times)

linuxfan

  • Jr. Member
  • **
  • Posts: 57
Labels the user can select and copy text from
« on: May 24, 2016, 07:58:38 am »
Hi,

I've seen around, on windows and may be other OSes, readonly labels the user can select text and copy from, but I don't find in LCL an equivalent. I've also tried Statictext.

Does someone know how to implement this, possibly in a portable way?

balazsszekely

  • Guest
Re: Labels the user can select and copy text from
« Reply #1 on: May 24, 2016, 08:52:48 am »
TLabel is inherited from TGraphicControl not TWinControl, so it cannot receive focus. I would try TEdit with the following properties:
      ReadOnly --> True
      Color --> BtnFace
      BorderStyle --> bsNone

Thaddy

  • Hero Member
  • *****
  • Posts: 14393
  • Sensorship about opinions does not belong here.
Re: Labels the user can select and copy text from
« Reply #2 on: May 24, 2016, 10:40:05 am »
Yup. Go for Getmem's suggestion. Note you should also hide the cursor.
You can still select the text and C/P
« Last Edit: May 24, 2016, 11:03:49 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

 

TinyPortal © 2005-2018