请教怎么用代码来改变字体的颜色
请问如何用代码来改变字体的颜色?
我是想当鼠标放到label1上时,label1上面的文字的颜色就变成红色。
procedure Tmonimain.Label1MouseEnter(Sender: TObject);
begin
font.Color:= 'clred ';
end;
编绎时提示错误如下:
[Error] w_monimain.pas(3892): Incompatible types: 'TColor ' and 'String '
请问应如何改,谢谢。
------解决方案--------------------
那你试试,Font.Color := clred呀;
------解决方案--------------------
Incompatible types: 'TColor ' and 'String '类型不匹配,TColor是一个枚举类型,clred已经是TColor的一个值了,引号引起来是画蛇添足,就是string了。
我是想当鼠标放到label1上时,label1上面的文字的颜色就变成红色。
procedure Tmonimain.Label1MouseEnter(Sender: TObject);
begin
font.Color:= 'clred ';
end;
编绎时提示错误如下:
[Error] w_monimain.pas(3892): Incompatible types: 'TColor ' and 'String '
请问应如何改,谢谢。
------解决方案--------------------
那你试试,Font.Color := clred呀;
------解决方案--------------------
Incompatible types: 'TColor ' and 'String '类型不匹配,TColor是一个枚举类型,clred已经是TColor的一个值了,引号引起来是画蛇添足,就是string了。