Anyone knows a kind of TLabel but which allows selecting the Text for copying? Something like windows uses for show the file size in the file property dialog?

Anyone knows a kind of TLabel but which allows selecting the Text for copying? Something like windows uses for show the file size in the file property dialog?
It also has to work with windows theming.

//EDIT: Ok, my problem is a little bit more complex. I used Edit1.ParentColor := True; to use the (themed) color of the backgrounds, but a TTabSheet breaks it. With theming the TTabSheet is always painted White, but his (not published property) Color is still clBtnFace. So the Edit uses clBtnFace on a white background.

Comments

  1. Leif Uneus TStaticText is of no help if the text is longer than the control, while for a read-only edit you can scroll horizontally to read the entire text.

    ReplyDelete
  2. This example should do the trick for the TEdit.

    TEdit = class(StdCtrls.TEdit)
    protected
    procedure CNCtlcoloredit(var Message: TWMCtlColor); message CN_CTLCOLOREDIT;
    end;

    procedure TEdit.CNCtlcoloredit(var Message: TWMCtlColor);
    begin
    if ParentBackground then
    PerformEraseBackground(Self, Message.ChildDC)
    else
    inherited;
    end;

    procedure TForm47.FormCreate(Sender: TObject);
    begin
    Edit1.ParentBackground := True;
    end;

    ReplyDelete

Post a Comment