1、登录窗口form1,主窗口form2,在form1的create中加下
if form2.showmodal <> mrok then Application.Terminate;
2、在form1的确定按钮中加入
F_main.Show;