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.
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.
Double-click on a TStaticText copies the caption to the clipboard. See http://stackoverflow.com/q/11121460/576719
ReplyDeletestackoverflow.com - double-clicking TStaticText in Delphi XE2 app copies caption to clipboard
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.
ReplyDeleteThis example should do the trick for the TEdit.
ReplyDeleteTEdit = 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;