打开一个页面太慢 如何作出处理(100)

3

343919

Unregistered / Unconfirmed
GUEST, unregistred user!
打开一个页面的代码如下application.CreateForm(Tform11,form11); if label4.Caption<>'管理员' then begin form11.GroupBox1.Visible:=false; form11.Edit17.Enabled:=false; form11.Button4.Enabled:=false; form11.Button7.Visible:=false; form11.Button6.Visible:=false; form11.DateTimePicker2.Visible:=false; form11.label26.Visible:=false; form11.Button9.Visible:=false; end else if (label4.Caption='管理员') and (form11.edit17.Text='1#') then begin form11.guanli:='管理'; form11.GroupBox1.Visible:=true; form11.Edit17.Enabled:=true; form11.Button4.Enabled:=true; end else if (label4.Caption='管理员') and (form11.edit17.Text<>'1#') then begin form11.GroupBox1.Visible:=false; form11.Button7.Visible:=false; form11.Button9.Visible:=false; end; form11.sname:=label6.Caption; form11.ShowModal; form11.Free;点击的时候 这个界面会变白 过了能有70多秒 这个界面里的数据才会显示出来,请问如何加一个滚动条或者别的 使滚动条显示到头的时候 这个界面的数据也处理完毕。谢谢
 
你的代码没有和数据库交互的操作,应该不会那么慢。另外你的代码我给你简单改了改,你可以参考一下:if label4.Caption <> '管理员' then begin form11.GroupBox1.Visible := false; form11.Edit17.Enabled := false; form11.Button4.Enabled := false; form11.Button7.Visible := false; form11.Button6.Visible := false; form11.DateTimePicker2.Visible := false; form11.label26.Visible := false; form11.Button9.Visible := false; end else begin if label4.Caption = '管理员' then begin if (form11.edit17.Text = '1#') then begin form11.guanli := '管理'; form11.GroupBox1.Visible := true; form11.Edit17.Enabled := true; form11.Button4.Enabled := true; end else begin form11.GroupBox1.Visible := false; form11.Button7.Visible := false; form11.Button9.Visible := false; end; end; end; form11.sname := label6.Caption; form11.ShowModal; form11.Free;
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部