我就是想实现像傲游那样,双击空白处便可以新增一个空白页,双击已经存在的SHEET就是关闭这个SHEET,请问高手该用什么事件,具体该怎么写
解决方案 »
- delphi 操作access数据库 出现“mismatch in datapacket”错误
- 如何判断控件上数据被更改
- 再加一百, DLL怎么捕获未知道错误
- 关于Twebbrowse控件使用问题。大大、高手请进->->->
- 求助高手(急)
- 字符串的问题
- 如何让程序运行后自己放到系统托盘里?
- 关于dbgrid的两个问题,请大家帮忙!!
- 如何设置用ADOConnection连接带有密码的SQL Server,ADOConnection哪个属性需要设置?急!!!!!
- 各位一定要去这个地方看看(http://redbobby.myetang.com/rb.htm)
- 所有的分都拿出来了---delphi 7+mysql5.0 +myODBC 存储过程调用及取得存储过程返回数据的问题
- 应用服务器不能连接数据库,socket方式
//****************************************************************
//打开tabForm过程参数1.ClassType:TComponentClass组件类 2.OpenFrom:TForm窗体
//****************************************************************
procedure TForm1.Open_Tab_Form(ClassType:TComponentClass;OpenFrom:TForm);
var
Thetabsheet:ttabsheet;
ThePanel:Tpanel;
begin
//动态创建tabsheet和panel
TheTabSheet := TTabSheet.Create(Self);
TheTabSheet.PageControl := PageControl1;
ThePanel:=Tpanel.Create(self);
ThePanel.Parent:= TheTabSheet;
ThePanel.Align:=alClient;
//ThePanel.DockSite:=true; // 将ThePanel.DockSite:=true则出现关闭条
//载入一个窗体到TAbsheet
application.CreateForm(ClassType,OpenFrom);
OpenFrom.Dock(ThePanel,BoundsRect);
OpenFrom.show;
TheTabSheet.Caption:=OpenFrom.Caption;
TheTabSheet.Show;
end;//****************************************************************
//双击tab关闭
//****************************************************************
procedure TForm1.PageControl1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
Index: Integer;
begin
if (Button = mbLeft) and (ssDouble in Shift) then
begin
Index := PageControl1.IndexOfTabAt(X, Y);
if Index >= 0 then
PageControl1.Pages[Index].Free;
end;
end;