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