大佬教程收集整理的这篇文章主要介绍了delphi – 在TLageControl上的TLinkLabel背景,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
// Image removed because the website doesn't exist any more // and I can't find it anywhere... Sorry.
您可以看到,父标签页的可爱渐变不会保留在链接文本后面.
我希望在流动的文本块(TLinkLabel提供的功能)中拥有多个链接的功能,并将父文本的背景显示在文本后面.
TLinkLabel没有ParentBackground属性.我已经尝试创建一个派生类,将csParentBackground添加到控件样式,无效:
TMyLinkLabel = class (TLinkLabel) public constructor Create(AOwner: TComponent); override; end; ... constructor TMyLinkLabel.Create(AOwner: TComponent); begin inherited; ControlStyle := ControlStyle - [csOpaque] + [csParentBackground] end;
任何人都有什么想法?
VCL有一个很好的重定向机制,让控件处理作为通知发送到其父窗口的消息.使用这个完全独立的透明链接标签可以创建:
type TTransparentLinkLabel = class(TLinkLabel) private procedure CNCtlColorStatic(var AMsg: TWMCtlColorStatic); message CN_CTLCOLORSTATIC; public constructor Create(AOwner: TComponent); override; end; constructor TTransparentLinkLabel.Create(AOwner: TComponent); begin inherited; ControlStyle := ControlStyle - [csOpaque] + [csParentBackground]; end; procedure TTransparentLinkLabel.CNCtlColorStatic(var AMsg: TWMCtlColorStatic); begin SetBkMode(AMsg.ChildDC,TRANSPARENT); AMsg.Result := GetStockObject(NULL_BRUSH); end;
以上是大佬教程为你收集整理的delphi – 在TLageControl上的TLinkLabel背景全部内容,希望文章能够帮你解决delphi – 在TLageControl上的TLinkLabel背景所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。