combobox 的按钮怎样修改呢? combobox 向下三角形的按钮 怎么修改呢?我想修改成蓝色背景的按钮 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 很简单你在Win32这个控件页上把XPManifest这个控件拖上去即可 Delphi 中有XP控件。用一下就可以了,但最好不要用,应该用了,在你Combobox中输入中文的时候,你按向前删除键的时候,会删除不了的。你可以试试看。 第三方控件,改变其style,可以有很多风格的 unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TComboBox=class(StdCtrls.TComboBox) private FButtonPicture:TPicture; procedure SetButtonPicture(const Value: TPicture); protected constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure WMPaint(var Message: TWMPaint); message WM_PAINT; published property ButtonPicture:TPicture read FButtonPicture write SetButtonPicture; end;type TForm1 = class(TForm) ComboBox1: TComboBox; private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}{$R ImgLst.res}{TCombobox}constructor TComboBox.Create(AOwner: TComponent);var bmp:TBitmap;begin inherited; FButtonPicture:=TPicture.Create; try bmp:=TBitmap.Create; bmp.Handle:=LoadBitmap(HInstance,'DROPCMD'); FButtonPicture.Bitmap.Assign(bmp); finally bmp.Free; end;end;destructor TComboBox.Destroy;begin FButtonPicture.Free; inherited;end;procedure TComboBox.SetButtonPicture(const Value: TPicture);begin FButtonPicture.Assign( Value);end;procedure TComboBox.WMPaint(var Message: TWMPaint);var C: TControlCanvas; R: TRect;begin inherited; if ctl3D then exit; C := TControlCanvas.Create; try C.Control:=Self; with C do begin R := ClientRect; c.Pen.Style:=psSolid; C.Pen.Color:=RGB(127,157,185); C.Pen.Width:=1; C.Brush.Style:=bsClear; C.Brush.Color:=clWhite; Rectangle(r); R.Left := R.Right - 17{GetSystemMetrics(SM_CXHTHUMB)} - 1; R.Top:=R.Top+1;R.Right:=R.Right-1;R.Bottom:=R.Bottom-1; StretchDraw(R,ButtonPicture.Graphic); end; finally c.Free; end;end;end. 看Raize 的 combox代码,不是很麻烦 主界面显示,为什么不那么直接的显示出来,而是很难看后才出来? 其实学好编译原理对以后用吗? 一个非常奇怪的问题,那位帮我解决,另外开贴子给200分! 虚拟示波器 广州的朋友可以进来看一看。 要高分来这里:关于Delphi报表控件的问题? 在程序中如何制作Word文档的页眉和页脚? 怎么让状态栏显示提示?? 学习开发自己的控件,该从哪入手??? 如何用Delphi4的TDbGrid 显示ORACLE存储过程返回的记录集 两个小问题:应该与Application对象有关 delphi中如何保存ToolBar的布局
你在Win32这个控件页上把XPManifest这个控件拖上去即可
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TComboBox=class(StdCtrls.TComboBox)
private
FButtonPicture:TPicture;
procedure SetButtonPicture(const Value: TPicture);
protected
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure WMPaint(var Message: TWMPaint); message WM_PAINT;
published
property ButtonPicture:TPicture read FButtonPicture write SetButtonPicture;
end;type
TForm1 = class(TForm)
ComboBox1: TComboBox;
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}
{$R ImgLst.res}{TCombobox}
constructor TComboBox.Create(AOwner: TComponent);
var bmp:TBitmap;
begin
inherited;
FButtonPicture:=TPicture.Create;
try
bmp:=TBitmap.Create;
bmp.Handle:=LoadBitmap(HInstance,'DROPCMD');
FButtonPicture.Bitmap.Assign(bmp);
finally
bmp.Free;
end;
end;destructor TComboBox.Destroy;
begin
FButtonPicture.Free;
inherited;
end;
procedure TComboBox.SetButtonPicture(const Value: TPicture);
begin
FButtonPicture.Assign( Value);
end;procedure TComboBox.WMPaint(var Message: TWMPaint);
var
C: TControlCanvas;
R: TRect;
begin
inherited;
if ctl3D then exit;
C := TControlCanvas.Create;
try
C.Control:=Self;
with C do
begin
R := ClientRect;
c.Pen.Style:=psSolid;
C.Pen.Color:=RGB(127,157,185);
C.Pen.Width:=1;
C.Brush.Style:=bsClear;
C.Brush.Color:=clWhite;
Rectangle(r);
R.Left := R.Right - 17{GetSystemMetrics(SM_CXHTHUMB)} - 1;
R.Top:=R.Top+1;R.Right:=R.Right-1;R.Bottom:=R.Bottom-1;
StretchDraw(R,ButtonPicture.Graphic);
end;
finally
c.Free;
end;
end;
end.