一个问题请教

zxjng 2000-07-25 03:23:00
各位有没有什么好的方法能够使一个form1在第一次运行的时候出现,当选择了
一个结果以后,弹出另一个form2,以后在运行程序的时候就不运行form1,而是
直接运行form2,不知道这可以通过什么实现,谢谢!
也就是说我想把form1选择的结果保存在form2中,可以吗?
最好详细点!
...全文
128 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
shylsz 2000-07-28
  • 打赏
  • 举报
回复
建一个表也可以啊,判断的表的某个字段的值就可以了!
meijg 2000-07-25
  • 打赏
  • 举报
回复
现在还没有想到,读写一个小文件也不难啊,或者给你一段读写注册表的代码
var
reg : TRegistry;
i : Integer;
begin
// Call base class
RootKey := HKEY_CURRENT_USER;
KeyName := REG_SETTINGS;
Result := inherited LoadSettings;
// Create a TRegistry object
reg := TRegistry.Create;
// Set the RootKey
reg.RootKey := HKEY_CURRENT_USER;
// Open the key where settings are stored
reg.OpenKey(REG_SETTINGS, True);
// Add a button in the QuickBar for each value stored in the registry
i := 0;
while reg.ValueExists(IntToStr(i)) do begin
AddButton(reg.ReadString(IntToStr(i)));这里读取注册表里的键值,写用writestring(..);

i := i + 1;
end;
// Close the key
reg.CloseKey;
// Free the TRegistry object
reg.Destroy;
end;
ljbcsdn 2000-07-25
  • 打赏
  • 举报
回复
first if you can edit the resourse file.
the main file you can see the procedure of creating window
you can call the funtion tform.create to constuctruct the window
and before you create the second window you can delete the first window
zxjng 2000-07-25
  • 打赏
  • 举报
回复
必须要写文件吗?没有更好的办法?
meijg 2000-07-25
  • 打赏
  • 举报
回复
可以用ini文件,或者干脆用一个文本文件,向里面写一个值,下次启动就读这个文件来判断条件,这和用注册表或ini文件的方法是一样的
zxjng 2000-07-25
  • 打赏
  • 举报
回复
form1运行后置一变量为true,怎么保存呢?
只有通过注册表吗?
Wingsun 2000-07-25
  • 打赏
  • 举报
回复
将这些信息记录在注册表中或一个Ini文件中,然后每一次启动时读取这个值判断是否显示Form1.
存取注册表使用TRegsitry、TRegsitryIniFile类。
存取Ini文件使用TIniFile类。
zsr 2000-07-25
  • 打赏
  • 举报
回复
可以。
FORM1运行后置一变量为true,下次运行前检查此值,如为true,直接调用Form2.

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧