我要做一个管理软件,里面有个主窗体,然后是很多子窗体,如果我一运行的话全部都初始化的话,是不是很费内存,能不能每点一个按钮打开一个子窗口,每点一个按钮就关闭当前活动的子窗体,再打开新窗体呢.给个例子看看好吗
[email protected]
[email protected]
解决方案 »
- 怎么样使Stringgrid插入的新纪录永远初一第一行
- DBGridEH1.options属性问题,知道的进来看看
- 请问怎么捕获IE关闭的消息?
- 有没有执行windows的粘贴操作的api?
- 请问如何把一个TreeView的所有节点完整的拷贝到另一个TreeView中表现?
- 请教各位:为什么不能访问sysobjects等系统表的“name”字段?
- 远程调用
- <<<<<<<<<<<<<<<<<<<<<<<windindance兄
- 怎样才可以把数据库中,储存JPG图片的字段的信息提取出来后,再转换成一个文件?
- 关于临界区的使用?
- 如何获得本地SQL SERVER服务名?
- T-SQL中调用一个有返回值的外部程序,如何得到返回值?
var
form2:TForm2;
begin
form2:=Tform2.Create(nil);
try
form2.ShowModal;
finally
FreeAndNil(form2);
end;end;
project/option.../forms
auto-create form 中把除首要FORM外不用的FORM都去掉.其余的按照上边那位老兄说的就可以.
http://www.resbbs.com/dispbbs.asp?boardID=9&ID=147
var
FrmMain: TFrmMain;
FMenu: TSeSkinItem;
NewChildClass: TFormClass;
NewChildForm: TForm;
......implementationprocedure TFrmMain.ItemClick(Sender: TObject);
begin if Assigned(NewChildForm) then
begin
try
NewChildForm.Free;
NewChildForm :=nil;
finally
FMenu.Enabled := True;
end;
end; case (Sender as TSeSkinItem).tag of
11: NewChildClass := TFrmCarInfo;
12: NewChildClass := TFrmDriverInfo;
13: NewChildClass := TFrmMasterInfo; 21: NewChildClass := TFrmTax;
22: NewChildClass := TFrmInsurance; 31: NewChildClass := TFrmPeccancy;
32: NewChildClass := TFrmAccident;
33: NewChildClass := TFrmRePair;
34: NewChildClass := TFrmLearn;
35: NewChildClass := TFrmFeedBack; 41: NewChildClass := TFrmCarQuery;
42: NewChildClass := TFrmDriverQuery;
43: NewChildClass := TFrmMasterQuery;
44: NewChildClass := TFrmInsuranceQuery;
45: NewChildClass := TFrmTaxQuery;
46: NewChildClass := TFrmPeccQuery;
47: NewChildClass := TFrmAccidentQuery;
48: NewChildClass := TFrmRepairQuery;
49: NewChildClass := TFrmLearnQuery; 51: NewChildClass := TFrmCarPrint;
52: NewChildClass := TFrmDriverPrint;
53: NewChildClass := TFrmMasterPrint;
54: NewChildClass := TFrmCarAgent;
55: NewChildClass := TFrmCarTransfer;
56: NewChildClass := TFrmTaxPrint;
57: NewChildClass := TFrmPeccPrint; 511:NewChildClass := TFrmCarNotePrint; 61: NewChildClass := TFrmRules; 71: NewChildClass := TFrmBaseTable;
72: NewChildClass := TFrmSysInit;
73: NewChildClass := TFrmprivilageSet;
74: NewChildClass := TFrmpayRuleSet;
75: NewChildClass := TFrmDBBackup;
else
NewChildClass := nil;
end; if Assigned(NewChildClass) then
begin
NewChildForm := NewChildClass.Create(Application);
with NewChildForm do
try
Hint := AppTitle;
BorderStyle := bsNone;
BorderIcons := [];
Parent := Self.Panel1;
WindowState := wsMaxiMized;
Align := alClient;
Show;
finally
FMenu := Sender as TSeSkinItem;
FMenu.Enabled := False;
end;
end;
Self.Caption := AppTitle + '¹ÜÀíϵͳ -> ' + NewChildForm.Caption;
end;