delphi控件边框颜色怎样改?

来源:百度知道 编辑:UC知道 时间:2024/07/05 02:52:11
窗体上有:TreeView、RichEdit、ComboBox、、、控件。
将ctl3D设为:false
之后,全部控件都是黑色边线,请问如何将全部控件边线画成蓝色?

因为窗口界面是蓝色调!

好象是 重画控件 或 自制控件 的麻烦提供代码!谢谢。
form1.Panel1.Canvas.pen=....可以正常画折线?
combobox1不在form1上,在Panel1上,应该怎样画?

这个有难度,如你说的得重画控件或自制控件,有一个flatstyle控件,能改变边框的颜色,但好像没有TreeView、RichEdit。
我只能做到给你的控件加一个黑色的边框,用ComboBox举例吧:
procedure TForm1.FormPaint(Sender: TObject);
begin
form1.Canvas.pen.color:=clblack;
form1.Canvas.pen.width:=3;
form1.Canvas.polyline([point(ComboBox1.left,ComboBox1.top),
point(ComboBox1.left+ComboBox1.width,ComboBox1.top),
point(ComboBox1.left+ComboBox1.width,ComboBox1.top+ComboBox1.height),
point(ComboBox1.left,ComboBox1.top+ComboBox1.height),
point(ComboBox1.left,ComboBox1.top)]);
end;

晕,这个问题有点初级!
比方说在form10上:
form10.Canvas.pen.color:=clblack;
form10.Canvas.pen.width:=3;
form10.Canvas.polyline([point(ComboBox1.left,ComboBox1.top),
point(ComboBox1.left+ComboBox1.width,ComboBox1.top),
point(ComboBox1.left+ComboBox1.width,ComboBox1.top+ComboBox1.height),
point(ComboBox1.left,ComboBox1.top+ComboBox1.height),
point(ComboBox1.left,ComboBox1.top)]);