第一次显示的窗体以后不在显示。 就象许多软件一样,第一次运行提示注册,注册之后此窗体不在显示。以后运行直接进入主窗体。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 标志放在注册表或ini文件中即可 通过写注册表可以但是如何读readstring()我的edi1.text=readstring()总提示错误了。 program Project1;uses Forms, INIfiles, SysUtils, Unit2 in 'Unit2.pas' {Form2}, Unit3 in 'Unit3.pas' {Form3};var MyIni: TIniFile; MyStr: String;{$R *.res}begin Application.Initialize; MyInI:= TIniFile.Create(ExtractFilePath(Application.ExeName)+'UseApp.INI'); Mystr:=MyInI.ReadString('Login','First',''); if (Mystr = '') or (MyStr = '2') then begin //我只想使form2显示一次。 //Application.CreateForm(Tform2, Form2); Application.CreateForm(Tform2, Form2); Form2:= TForm2.Create(Application); Form2.Show; MyIni.WriteString('Login','First','2');//我在form2的button事件中 MyIni.WriteString('Login','First','1') end else begin //Application.CreateForm(Tform3, Form3); Application.CreateForm(Tform3, Form3); Form3:= TForm3.Create(Application); Form3.Show; end; MyIni.Free; Application.Run;end.我今天试着用ini大家看看总调试不过去。 program Project1;uses Forms, INIfiles, SysUtils, Unit2 in 'Unit2.pas' {Form2}, Unit3 in 'Unit3.pas' {Form3};var MyIni: TIniFile; MyStr: String;{$R *.res}begin Application.Initialize; MyInI:= TIniFile.Create(ExtractFilePath(Application.ExeName)+'UseApp.INI'); Mystr:=MyInI.ReadString('Login','First',''); if (Mystr = '') or (MyStr = '2') then begin //我只想使form2显示一次。 //Application.CreateForm(Tform2, Form2); Application.CreateForm(Tform2, Form2); Form2:= TForm2.Create(Application); Form2.Show; MyIni.WriteString('Login','First','2'); //我在form2的button事件中再使 MyIni.WriteString('Login','First','1') end else begin //Application.CreateForm(Tform3, Form3); Application.CreateForm(Tform3, Form3); Form3:= TForm3.Create(Application); Form3.Show; end; MyIni.Free; Application.Run;end. interfaceuses IniFiles; Application.CreateForm(Tform2, Form2);和Form2:= TForm2.Create(Application);好像重复了吧,你去调Form2:= TForm2.Create(Application);试试看 Application.CreateForm(Tform2, Form2);和Form2:= TForm2.Create(Application);中任何一个留下都不好使。 疑难问题求DataSet取得9位整数8位小数 怎么自动判断某个串口是硬件使用的串口? 做一个类似qq的聊天程序,大家给点思路; 求救!!!Dll文件报错!!! 数据库高手请进,问题请教 真的很急急急急急急 或许这个问题并不难,但是急需。(100分) 关于StringGird导出数据到Execl数据格式问题。 Q1xp 开发版问世,您可以轻松编写自己的ICQ/OICQ系统了。 怎样判断Webbrowser能否GoBack,Goforward? 查询出现焦点失控? 如何实现考勤记录合并 SQL语句
我的edi1.text=readstring()总提示错误了。
Forms,
INIfiles,
SysUtils,
Unit2 in 'Unit2.pas' {Form2},
Unit3 in 'Unit3.pas' {Form3};var
MyIni: TIniFile;
MyStr: String;
{$R *.res}begin
Application.Initialize;
MyInI:= TIniFile.Create(ExtractFilePath(Application.ExeName)+'UseApp.INI');
Mystr:=MyInI.ReadString('Login','First','');
if (Mystr = '') or (MyStr = '2') then
begin
//我只想使form2显示一次。
//Application.CreateForm(Tform2, Form2);
Application.CreateForm(Tform2, Form2);
Form2:= TForm2.Create(Application);
Form2.Show;
MyIni.WriteString('Login','First','2');//我在form2的button事件中 MyIni.WriteString('Login','First','1')
end
else
begin
//Application.CreateForm(Tform3, Form3);
Application.CreateForm(Tform3, Form3);
Form3:= TForm3.Create(Application);
Form3.Show;
end;
MyIni.Free;
Application.Run;
end.
我今天试着用ini大家看看总调试不过去。
Forms,
INIfiles,
SysUtils,
Unit2 in 'Unit2.pas' {Form2},
Unit3 in 'Unit3.pas' {Form3};var
MyIni: TIniFile;
MyStr: String;
{$R *.res}begin
Application.Initialize;
MyInI:= TIniFile.Create(ExtractFilePath(Application.ExeName)+'UseApp.INI');
Mystr:=MyInI.ReadString('Login','First','');
if (Mystr = '') or (MyStr = '2') then
begin
//我只想使form2显示一次。
//Application.CreateForm(Tform2, Form2);
Application.CreateForm(Tform2, Form2);
Form2:= TForm2.Create(Application);
Form2.Show;
MyIni.WriteString('Login','First','2');
//我在form2的button事件中再使 MyIni.WriteString('Login','First','1')
end
else
begin
//Application.CreateForm(Tform3, Form3);
Application.CreateForm(Tform3, Form3);
Form3:= TForm3.Create(Application);
Form3.Show;
end;
MyIni.Free;
Application.Run;
end.
IniFiles;
和Form2:= TForm2.Create(Application);
好像重复了吧,你去调Form2:= TForm2.Create(Application);试试看
和Form2:= TForm2.Create(Application);中任何一个留下都不好使。