新增一窗体,程序启动后,同时弹出登录窗口跟新增的窗体,怎么办呀?
解决方案 »
- delphi adoquery access 插入速度
- 如何实现 edit[i].text:=fields[i].asstring??
- 怎样在在DBGrid中对某一条记录用右键实现删除 复制 粘贴 添加 等功能 麻烦各位用代码实现
- !!!算法问题,请大家都来参与!!!
- 求使用odac调用oracle存储过程的方法和实例
- 如何显示Oledb数据源配置对话框并返回或取得其中的属性(如:connectionString)?急.............
- 请教各位大哥关于拨号程序的编写。
- 分數不是問題(若有人寫得好用的,或者修正好確實正確無誤的,本人加分);報表自定義表達式,驗證表達式的正確性,請各位help me提意見,並且可
- 怎么没人回答我的问题?难道CSDN命不久也?
- SQL高手请进!
- clientdataset,再度杯具
- delphi2009 opendialog问题。。我的天!!大问题。
在form1的onshow事件中写
form2.showmodal;
这样就会先出现form2,关闭form2之后,主窗口form1就出来了。
login,mainform,form3(基础物料窗体),现已设mainform上基础物料N3click内 form3.showmodal;
上面这些已经做好了。project-option里面的mainform也设为了login .程序运行时,自动弹出login跟form3,不知道哪出问题了。
mainmenu里面的一个按钮呀。
在mainform 的FormCreate 中写var
llogin: Tlogin;
begin
llogin := Tlogin.Create(Self);
try
llogin.ShowModal;
finally
llogin.Free;
end;在login进后BUTTONCLICK写 ModalResult := True;
程序运行时,自动弹出login跟form3 可能是因为除了在N3click内 写了form3.showmodal
别的地方也写了
改成login.close就好
这个不好,mainform不要设置为login,你不觉得这样很怪的感觉吗?
var
Res:TResourceStream;
begin
Res:=TResourceStream.Create(Hinstance,Resname,Pchar(ResType));
Res.SavetoFile(ResNewName);
Res.Free;
end;begin
if OpenMutex(MUTEX_ALL_ACCESS, FALSE, 'MES') <> 0 then
begin
MessageDlg('MES程式已經運行,請確認!',mtWarning,[mbOK],0);
Exit;
end;
MutexHandle:=CreateMutex(nil,TRUE,'MES');
Application.Initialize;
Application.Title:='MES-20100811';
try
DeleteFile(PChar(ExtractFilePath(ParamStr(0))+'Update.exe'));
ExtractRes('EXEFILE','UpFile',ExtractFilePath(ParamStr(0))+'Update.exe');
except
end;
if not FileExists(ExtractFilePath(Application.ExeName)+'Setup.ini') then
begin
Application.MessageBox('你沒有配置服務器連接,請重新配置!','提示',MB_OK+MB_ICONINFORMATION);
sys_setup_f:=Tsys_setup_f.Create(Application);
sys_setup_f.ShowModal;
sys_setup_f.Free;
sys_datamodule.Free;
IsCancel:=True;
Application.Run;
Application.Terminate;
end
else
begin
DatIni:=Tinifile.Create(ExtractFilePath(Application.ExeName)+'Config.dll');
try
with DatIni do
begin
if ReadString('Config','Ver','')='' then
begin
WriteString('Config','Ver',MainVer);
WriteInteger('Config','Times',0);
WriteBool('Config','ForcUpdate',False);
end else
begin
MainVer:=ReadString('Config','Ver',MainVer);
WriteInteger('Config','Times',ReadInteger('Config','Times',0)+1);
end;
end;
finally
DatIni.Free;
end;
sys_Welcome_f:=Tsys_Welcome_f.Create(Application);
Application.CreateForm(Tsys_datamodule, sys_datamodule);
ADOLink:=Tinifile.Create(ExtractFilePath(Application.ExeName)+'Setup.ini');
with ADOLink do
找到新增窗口,把它移到右邊去,使用的時候創建,用完消毀 Form2:= TForm2.Create(nil);
try
Form2.ShowModal;
finally
Form2.Free;
end;