object Form1: TForm1
Left = 192
Top = 114
Width = 696
Height = 480
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 Panel1: TPanel
Left = 0
Top = 0
Width = 185
Height = 446
Align = alLeft
Caption = 'Panel1'
TabOrder = 0
object ComboBox62: TComboBox
Left = 56
Top = 360
Width = 145
Height = 21
ItemHeight = 13
TabOrder = 0
Text = 'ComboBox62'
OnChange = ComboBox62Change
end
end
object Panel2: TPanel
Left = 185
Top = 0
Width = 503
Height = 446
Align = alClient
Caption = 'Panel2'
TabOrder = 1
object mygroupbox: TGroupBox
Left = 1
Top = 1
Width = 501
Height = 368
Align = alTop
Caption = 'mygroupbox'
TabOrder = 0
end
object Button1: TButton
Left = 200
Top = 384
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 1
OnClick = Button1Click
end
end
end--------------------------------------------------------------------------------
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;type
TForm1 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
mygroupbox: TGroupBox;
Button1: TButton;
ComboBox62: TComboBox;
procedure Button1Click(Sender: TObject);
procedure ComboBox62Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
v_height:integer;
nc_label:tlabel;
nc_combobox1:tcombobox;
begin
nc_label:=tlabel.Create(self);
nc_label.Parent:=mygroupbox;
nc_label.Caption:='v_cap';
nc_label.top:=mygroupbox.Top+1*v_height+24;
nc_label.left:=mygroupbox.left+24;
nc_label.width:=150;
nc_label.Height:=13;
nc_label.Visible:=true; nc_combobox1:=tcombobox.Create(self);
nc_combobox1.Parent:=mygroupbox;
nc_combobox1.Top:=mygroupbox.Top+1*v_height+16;
nc_combobox1.left:=mygroupbox.left+216;
nc_combobox1.width:=49;
nc_combobox1.Height:=21;
nc_combobox1.Items.Append('0');
nc_combobox1.Items.Append('1');
nc_combobox1.Items.Append('2');
nc_combobox1.Items.Append('3');
nc_combobox1.Items.Append('4');
nc_combobox1.Items.Append('5');
nc_combobox1.OnChange:=ComboBox62Change;
nc_combobox1.Visible:=true;end;procedure TForm1.ComboBox62Change(Sender: TObject);
begin
//
end;end.
Left = 192
Top = 114
Width = 696
Height = 480
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 Panel1: TPanel
Left = 0
Top = 0
Width = 185
Height = 446
Align = alLeft
Caption = 'Panel1'
TabOrder = 0
object ComboBox62: TComboBox
Left = 56
Top = 360
Width = 145
Height = 21
ItemHeight = 13
TabOrder = 0
Text = 'ComboBox62'
OnChange = ComboBox62Change
end
end
object Panel2: TPanel
Left = 185
Top = 0
Width = 503
Height = 446
Align = alClient
Caption = 'Panel2'
TabOrder = 1
object mygroupbox: TGroupBox
Left = 1
Top = 1
Width = 501
Height = 368
Align = alTop
Caption = 'mygroupbox'
TabOrder = 0
end
object Button1: TButton
Left = 200
Top = 384
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 1
OnClick = Button1Click
end
end
end--------------------------------------------------------------------------------
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;type
TForm1 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
mygroupbox: TGroupBox;
Button1: TButton;
ComboBox62: TComboBox;
procedure Button1Click(Sender: TObject);
procedure ComboBox62Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
v_height:integer;
nc_label:tlabel;
nc_combobox1:tcombobox;
begin
nc_label:=tlabel.Create(self);
nc_label.Parent:=mygroupbox;
nc_label.Caption:='v_cap';
nc_label.top:=mygroupbox.Top+1*v_height+24;
nc_label.left:=mygroupbox.left+24;
nc_label.width:=150;
nc_label.Height:=13;
nc_label.Visible:=true; nc_combobox1:=tcombobox.Create(self);
nc_combobox1.Parent:=mygroupbox;
nc_combobox1.Top:=mygroupbox.Top+1*v_height+16;
nc_combobox1.left:=mygroupbox.left+216;
nc_combobox1.width:=49;
nc_combobox1.Height:=21;
nc_combobox1.Items.Append('0');
nc_combobox1.Items.Append('1');
nc_combobox1.Items.Append('2');
nc_combobox1.Items.Append('3');
nc_combobox1.Items.Append('4');
nc_combobox1.Items.Append('5');
nc_combobox1.OnChange:=ComboBox62Change;
nc_combobox1.Visible:=true;end;procedure TForm1.ComboBox62Change(Sender: TObject);
begin
//
end;end.
解决方案 »
- 求助,关于DELPHI浏览PDF文件的
- 有关字体大小的问题,谁能帮我解决一下,谢谢?
- XP下做的程序在98下面窗口显示不正确,怎么办?在线等!
- if CheckBox1.click=true then Label1.visable=true...以此类推CheckBox是第几,Label1就是第几,怎么写?
- 大家怎么加上的星星,我为什么一直都没有加?
- 如何将eventmsg类数据保存到数据库?
- 各位高手请帮忙!急!急!急!(在线等待)
- 有谁用过flatstyle控件,它的按钮没有onkeydown方法,请问有没有办法加上
- 怎样改变treeview一个节点字体的颜色?
- 新年礼物:如何修改目录建立时间。
- 关于DELPHI调用C++写的DLL问题(120分)
- 一个奇怪的问题,关于控制EmbeddedWB中的滚动条自动滚动发现的问题!
nc_label.Parent:=mygroupbox; ????
nc_label.Caption:='v_cap';
nc_label.top:=mygroupbox.Top+1*v_height+24; ???
nc_label.left:=mygroupbox.left+24;既然父是mygroupbox,为什么label的top/left是父top/left呢?