I would like to select a managed shortcut control like the one shown in the screenshot. This can be done with TEdit fieldless, but I was wondering if there is another way to work with gradient background?
example http://usera.ImageCave.com/brk303/SelectableLabel.png.jpg
To clarify, I use a simple PageControl, which with Win XP has a gradient drawing, without TEdit fields, placed on the page, does not fit perfectly:
Edit on the Control page http://usera.ImageCave.com/brk303/Gradient.png.jpg
Update:
I managed to get half way by adding
procedure CNCtlColorStatic(var AMsg: TWMCtlColorStatic); message CN_CTLCOLORSTATIC; procedure TTransparentEdit.CNCtlColorStatic(var AMsg: TWMCtlColorStatic); begin with ThemeServices do if ThemesEnabled then begin SetBkMode(AMsg.ChildDC, Windows.TRANSPARENT); DrawParentBackground(Handle, AMsg.ChildDC, nil, False); AMsg.Result := GetStockObject(NULL_BRUSH); end else inherited; end;
Now it is transparent, but something else needs to be done, since painting when choosing text does not work properly. The behavior is hard to explain, I will investigate further and update here ...
source share