采用动态创建
procedure TMainForm.Button1Click(Sender: TObject);
var
t: TTabSheet;
w: TWebBrowser;
begin
t := TTabSheet.Create(PageControl1);
t.PageControl := PageControl1;
t.Caption := 'TabSheet' + IntToStr(PageControl1.PageCount);
PageControl1.ActivePageIndex := t.PageIndex;
w := TWebBrowser.Create(t);
TWinControl(w).Parent := t;
w.Align := alClient;
end;怎么调用他的onclick、onmousedown等事件????
procedure TMainForm.Button1Click(Sender: TObject);
var
t: TTabSheet;
w: TWebBrowser;
begin
t := TTabSheet.Create(PageControl1);
t.PageControl := PageControl1;
t.Caption := 'TabSheet' + IntToStr(PageControl1.PageCount);
PageControl1.ActivePageIndex := t.PageIndex;
w := TWebBrowser.Create(t);
TWinControl(w).Parent := t;
w.Align := alClient;
end;怎么调用他的onclick、onmousedown等事件????
解决方案 »
- delphi 使用TThreadList的remove方法时......
- activex中如何调用第三方的dll函数?
- DataGrid使用
- delphi如何往数据库插入数据。
- 怎么让dbgrideh1的某个横行为绿色。
- 调用dll的问题,请各位大虾进来看看!!
- delphi里面定时器组件的问题!!!!!!!!!!!!!!!!
- 有没有办法在调试的时候,让捕获错误的功能起作用?
- 十万火急:mdf和ldf是什么数据库的格式,DELPHI可以访问吗?????
- 我在安装ORACLE8时提示要加大虚存,不知加C还是D?多大值?请告之详细步骤,谢谢!
- 表“编号”要求手工输入,还有必须在表中添加一个自动编号的“库号”吗?
- ■■■Flash伴侣--小软件发布,顺便散分!!使用Flash的朋友有福了!!■■■
begin
(Sender as TButton).Caption:='MyButton';
……
end;MyButton.OnClick:=Myclick;
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure buttonClickEvent(sender:TObject);
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}
procedure TForm1.buttonClickEvent(sender:TObject);
begin
showMessage('asdlfj;lasdkfj;asdlfjasl');
end;procedure TForm1.Button1Click(Sender: TObject);
var
button:TButton;
begin
button:=TButton.Create(form1);
button.Caption:='http://www.goomoo.net';
button.Left:=20;
button.Width:=300;
button.Top:=20;
button.OnClick:=buttonClickEvent;
button.Parent:=form1;
end;