gpt4 book ai didi

带 Aero 玻璃的 Windows 版本的 Delphi 2010 按钮将文本变为白色

转载 作者:行者123 更新时间:2023-12-03 15:29:06 24 4
gpt4 key购买 nike

前几天,我开始在Delphi中玩不同的视觉效果,并在使用Aero Glass效果时遇到了问题(我安装了Delphi 2010):当我将按钮放在玻璃上时,该按钮的某些部分(或其他一些元素)燃烧并变得透明。我不知道为什么,但我尝试在其他计算机上执行相同的示例。并且这个错误重复出现。

有错误的屏幕截图;第二个按钮的标题是透明的: enter image description here

我的示例程序:

program Project1;

uses
Forms,
Unit1 in 'Unit1.pas' {Form1};

{$R *.res}

begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
<小时/>
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

end.
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 202
ClientWidth = 331
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
GlassFrame.Enabled = True
GlassFrame.Bottom = 50
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 64
Top = 153
Width = 175
Height = 41
Caption = 'Button1'
Font.Charset = DEFAULT_CHARSET
Font.Color = clMenuHighlight
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 0
end
object Button2: TButton
Left = 64
Top = 73
Width = 175
Height = 41
Caption = 'Button1'
Font.Charset = DEFAULT_CHARSET
Font.Color = clMenuHighlight
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 1
end
end

最佳答案

这是 Delphi 2010 对“玻璃”(使用 DWM 的航空组合)支持中的一个已知错误,我相信它已在 Delphi XE 中修复,我选择使用的解决方法是使用我自己的自定义 TButton 类类.

当我在 2010 年看到这个错误时,我向 Embarcadero 报告了这个错误,就像其他人一样,我似乎找不到 QC#(错误报告#),但建议的双缓冲解决方法对我来说是 Not Acceptable 。 TBitBtn 我相信并没有出现这个问题,这是我最简单的解决方法,尽管它还有其他问题。

Delphi 2010 中有很多玻璃问题。一般建议;升级德尔福。

关于带 Aero 玻璃的 Windows 版本的 Delphi 2010 按钮将文本变为白色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16019241/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com