combobox 向下三角形的按钮 怎么修改呢?
我想修改成蓝色背景的按钮

解决方案 »

  1.   

    很简单
    你在Win32这个控件页上把XPManifest这个控件拖上去即可
      

  2.   

    Delphi 中有XP控件。用一下就可以了,但最好不要用,应该用了,在你Combobox中输入中文的时候,你按向前删除键的时候,会删除不了的。你可以试试看。
      

  3.   

    第三方控件,改变其style,可以有很多风格的
      

  4.   

    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.
      

  5.   

    看Raize 的 combox代码,不是很麻烦