在delphi中combobox,updown的那个键头下的灰色背景,如何才能透明(或者说是更改为与表单背景色一致)
解决方案 »
- Delhi怎么调用OCX
- 怎么自定义控件的事件函数? 急! 在线等
- 怎样用delphi做触摸屏查询?
- 把query中查询出的数据倒成文本文件怎么倒??
- 工作难找,心情不好,坛子开了,专家会丢了,收藏夹空了散100
- 请问用delphi怎么才能自动新建一个文件夹...
- 有什么办法可以取得输往音箱的电流强度,以便在屏幕上显示波形。
- 简单问题 出现“reader.exe-应用程序错误”高手请进啊,急。。。。
- 入门问题:如何安装第三方控件?
- Object Pascal的初级问题大送分.
- 查询语句问题(在线等)
- 请问如果实现象SQL2k的查询分析器那样的界面,上边是菜单,左右各有一个窗体,并且拖住一个窗的一侧改变大小时另一个窗体的大小也随之改
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
ComboBox1: TComboBox;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
CBOldProc: TWndMethod;
public
{ Public declarations }
procedure CBNewWndProc(var message: TMessage);
end;var
Form1: TForm1;implementation{$R *.dfm}
procedure TForm1.CBNewWndProc(var message: TMessage);
var
cbInfo: TComboBoxInfo;
AP: array [0..2] of TPoint;
begin
if message.Msg = WM_PAINT then
begin
CBOldProc(Message);
cbInfo.cbSize:= SizeOf(cbInfo);
GetComboBoxInfo(ComboBox1.Handle, cbInfo);
ComboBox1.Canvas.Pen.Width:= 1;
ComboBox1.Canvas.Brush.Style:= bsSolid;
if cbInfo.stateButton = STATE_SYSTEM_PRESSED then
ComboBox1.Canvas.Brush.Color:= clGreen
else
ComboBox1.Canvas.Brush.Color:= clRed;
ComboBox1.Canvas.Rectangle(cbInfo.rcButton);
ComboBox1.Canvas.Brush.Color:= clBlack;
ComboBox1.Canvas.Polygon(Ap);
end
else
CBOldProc(Message);
end;procedure TForm1.FormCreate(Sender: TObject);
begin
CBOldProc:= Combobox1.WindowProc;
ComboBox1.WindowProc:= CBNewWndProc;
end;end.
procedure TForm1.FormCreate(Sender: TObject);
begin
SpeedButton1.Height := ComboBox1.ClientHeight - 3;
SpeedButton1.Width := ComboBox1.ClientHeight - 3;
SpeedButton1.Parent := ComboBox1;
SpeedButton1.Left := ComboBox1.ClientWidth - SpeedButton1.Width - 2;
SpeedButton1.Top := 2;
end;procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
ComboBox1.DroppedDown := not ComboBox1.DroppedDown;
end;