Delphi中form create 一直不制动执行,看看我代码有什么错误
建了一个窗体就加了一个PageControl控件unitUnit1;interfaceusesWindows,Messages,SysUtils,Variants,Cla...
建了一个窗体 就加了一个PageControl控件 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls; type TForm1 = class(TForm) PageControl1: TPageControl; procedure FormCreate(Sender: TObject); procedure PageControl1Change(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); var i:integer; begin for i:=0 to 9 do with TTabSheet.Create(self) do begin PageControl:=PageControl1; caption:='TabSheet #'+IntToStr(i); end; end; procedure TForm1.PageControl1Change(Sender: TObject); var prevcaption,nextcaption:shortstring; begin with (sender as tpagecontrol) do begin prevcaption:=findnextpage(activepage,false,false).caption; nextcaption:=findnextpage(activepage,true,false).caption; end; showmessage('previous tab caption:"'+prevcaption+ '" next tab caption: "'+nextcaption+'"') ; end; end.
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询