页中控件是程序创建的.
ShowMessage(inttostr(PageControl1.ActivePage.PageControl.ControlCount)); //显示多少页
ShowMessage(inttostr( PageControl1.ActivePage.ControlCount-1)); //这样得不到有多少个控件
解决方案 »
- 在上海或者南京找delphi的工作 工资要多少呀?
- 请教!(急!急!急!急!)在线等!!!
- 显示图像的简单问题,如何让他按y轴显示数据(up有分)应该不太难,怎么没人领分呢?可是问了很久都没人能做出来?郁闷
- Delphi中使用.net写的webservice所返回的Dataset类
- 请问如何实现录入完数据后关闭,为什么我调用了close却无法关闭
- DLL的问题,IMAGE为何不能在DLL中?
- 怎么样实现让提示框的焦点放到“取消”按钮上?
- 高分求一解:timage如何显示blob中的图象
- 在报表进行换行时充坏了表格线?
- 能否用HOOK技术来实现?
- 老菜鸟又碰上了头痛的报表问题
- 难题,需要读取,写入虚拟空间上SQL Server的数据,有什么更好的办法
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls;type
TForm1 = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var Label1:TLabel;
Edit1:TEdit;
Button1:TButton;
Memo1:TMemo;
begin
Label1:=TLabel.Create(Self);
Label1.Caption:='Label1';
Label1.Left:=10;
Label1.Top:=10;
Label1.Parent:=TabSheet1;
ShowMessage(IntToStr(PageControl1.ActivePage.ControlCount));
Edit1:=TEdit.Create(Self);
Edit1.Text:='Edit1';
Edit1.Left:=10;
Edit1.Top:=25;
Edit1.Parent:=TabSheet1;
ShowMessage(IntToStr(PageControl1.ActivePage.ControlCount));
Button1:=TButton.Create(Self);
Button1.Caption:='Button1';
Button1.Left:=10;
Button1.Top:=45;
Button1.Parent:=TabSheet1;
ShowMessage(IntToStr(PageControl1.ActivePage.ControlCount));
Memo1:=TMemo.Create(Self);
Memo1.Text:='Memo1';
Memo1.Left:=10;
Memo1.Top:=70;
Memo1.Parent:=TabSheet1;
ShowMessage(IntToStr(PageControl1.ActivePage.ControlCount));
end;end.
ShowMessage(inttostr( PageControl1.ActivePage.ControlCount)); //有多少个控件