Tcombobox没有borderstyle属性,我需要如何创建一个没有三维外观和边框的ComboBox,怎么办? 你可以用 edit, button, listbox 拼成一个combobox. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 去下载一个FlatStyler的控件包吧,里边有你想要的东西! //我用的是一个变态的方法//就是用面板将其边界盖住unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtrls, ExtCtrls;type TForm1 = class(TForm) ComboBox1: TComboBox; Panel1: TPanel; Panel2: TPanel; Panel3: TPanel; Panel4: TPanel; Panel5: TPanel; Button1: TButton; ComboBox2: TComboBox; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.DFM}procedure bsNoneComboBox(mComboBox: TComboBox);begin with TPanel.Create(mComboBox) do begin Parent := mComboBox.Parent; Width := mComboBox.Width; Top := mComboBox.Top; Left := mComboBox.Left; ParentColor := True; Height := 2; BevelOuter := bvNone; end; with TPanel.Create(mComboBox) do begin Parent := mComboBox.Parent; Width := mComboBox.Width; Top := mComboBox.Top + mComboBox.Height - 1; Left := mComboBox.Left; ParentColor := True; Height := 2; BevelOuter := bvNone; end; with TPanel.Create(mComboBox) do begin Parent := mComboBox.Parent; Width := mComboBox.Width; Top := mComboBox.Top; Left := mComboBox.Left; ParentColor := True; Height := mComboBox.Height; Width := 2; BevelOuter := bvNone; end; with TPanel.Create(mComboBox) do begin Parent := mComboBox.Parent; Width := mComboBox.Width; Top := mComboBox.Top; Left := mComboBox.Left + mComboBox.Width - 1; ParentColor := True; Height := mComboBox.Height; Width := 2; BevelOuter := bvNone; end;end;procedure TForm1.Button1Click(Sender: TObject);begin bsNoneComboBox(ComboBox2);end;end.//dfmobject Form1: TForm1 Left = 192 Top = 107 Width = 544 Height = 375 Caption = 'Form1' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False PixelsPerInch = 96 TextHeight = 13 object ComboBox1: TComboBox Left = 32 Top = 16 Width = 145 Height = 21 ItemHeight = 13 TabOrder = 0 Text = 'ComboBox1' end object Panel1: TPanel Left = 24 Top = 36 Width = 185 Height = 10 BevelOuter = bvNone TabOrder = 1 end object Panel2: TPanel Left = 32 Top = 36 Width = 145 Height = 10 BevelOuter = bvNone TabOrder = 2 end object Panel3: TPanel Left = 33 Top = 8 Width = 141 Height = 10 BevelOuter = bvNone TabOrder = 3 end object Panel4: TPanel Left = 9 Top = 7 Width = 25 Height = 45 BevelOuter = bvNone TabOrder = 4 end object Panel5: TPanel Left = 175 Top = 3 Width = 25 Height = 45 BevelOuter = bvNone TabOrder = 5 end object Button1: TButton Left = 272 Top = 128 Width = 75 Height = 25 Caption = 'Button1' TabOrder = 6 OnClick = Button1Click end object ComboBox2: TComboBox Left = 320 Top = 32 Width = 145 Height = 21 ItemHeight = 13 TabOrder = 7 Text = 'ComboBox2' endend 有那们兄弟用过Delphi Scintilla,有的进来看看 Delphi 窗口置顶问题 ado 连接操作dbf文件 下载网站上的文件的一个小问题!100分!不够再加! 请问如何把客户端自定义的记录类型参数传递到中间层中? 一个巨简单的问题,关于DBGrid的 请教关于文件读写的问题,大虾满一定帮忙啊! 属性与变量的区别 关于dbgrid的一个小问题 AnimateWindow动画功能,为什么只有在第一次创建窗口时起作用,对于非模态窗口,在执行show命令时为什么不起作用? 请问谁有希望出版社的SQL SEVER 2000 编程员指南的电子书? 如何能让程序小一点?
//就是用面板将其边界盖住unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, OleCtrls, ExtCtrls;type
TForm1 = class(TForm)
ComboBox1: TComboBox;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
Panel5: TPanel;
Button1: TButton;
ComboBox2: TComboBox;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure bsNoneComboBox(mComboBox: TComboBox);
begin
with TPanel.Create(mComboBox) do begin
Parent := mComboBox.Parent;
Width := mComboBox.Width;
Top := mComboBox.Top;
Left := mComboBox.Left;
ParentColor := True;
Height := 2;
BevelOuter := bvNone;
end; with TPanel.Create(mComboBox) do begin
Parent := mComboBox.Parent;
Width := mComboBox.Width;
Top := mComboBox.Top + mComboBox.Height - 1;
Left := mComboBox.Left;
ParentColor := True;
Height := 2;
BevelOuter := bvNone;
end; with TPanel.Create(mComboBox) do begin
Parent := mComboBox.Parent;
Width := mComboBox.Width;
Top := mComboBox.Top;
Left := mComboBox.Left;
ParentColor := True;
Height := mComboBox.Height;
Width := 2;
BevelOuter := bvNone;
end; with TPanel.Create(mComboBox) do begin
Parent := mComboBox.Parent;
Width := mComboBox.Width;
Top := mComboBox.Top;
Left := mComboBox.Left + mComboBox.Width - 1;
ParentColor := True;
Height := mComboBox.Height;
Width := 2;
BevelOuter := bvNone;
end;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
bsNoneComboBox(ComboBox2);
end;end.//dfm
object Form1: TForm1
Left = 192
Top = 107
Width = 544
Height = 375
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object ComboBox1: TComboBox
Left = 32
Top = 16
Width = 145
Height = 21
ItemHeight = 13
TabOrder = 0
Text = 'ComboBox1'
end
object Panel1: TPanel
Left = 24
Top = 36
Width = 185
Height = 10
BevelOuter = bvNone
TabOrder = 1
end
object Panel2: TPanel
Left = 32
Top = 36
Width = 145
Height = 10
BevelOuter = bvNone
TabOrder = 2
end
object Panel3: TPanel
Left = 33
Top = 8
Width = 141
Height = 10
BevelOuter = bvNone
TabOrder = 3
end
object Panel4: TPanel
Left = 9
Top = 7
Width = 25
Height = 45
BevelOuter = bvNone
TabOrder = 4
end
object Panel5: TPanel
Left = 175
Top = 3
Width = 25
Height = 45
BevelOuter = bvNone
TabOrder = 5
end
object Button1: TButton
Left = 272
Top = 128
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 6
OnClick = Button1Click
end
object ComboBox2: TComboBox
Left = 320
Top = 32
Width = 145
Height = 21
ItemHeight = 13
TabOrder = 7
Text = 'ComboBox2'
end
end