Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 05-30-2007, 09:20 AM
ZarrinPour ZarrinPour is offline
Senior Member
 
Join Date: Jul 2003
Posts: 232
Default My Form takes a lot of time to appear....Could AnyOne help me.?

Hi all
I have an MDI-Child Form in my App that it takes long time to appear on Screen So i put four labels on my form
and in the Begining and Ending of [OnShow] and [OnActivate] events, i initialized above Labels with following commands

procedure TAccMainForm.FormShow(Sender: TObject);
begin
Label1.Caption:=FormatDateTime('MM:SS',Now); // Form Show Begin
..
...
Label2.Caption:=FormatDateTime('MM:SS',Now); // Form Show End
End;



procedure TAccMainForm.FormActivate(Sender: TObject);
begin

Label3.Caption:=FormatDateTime('MM:SS',Now); // Form Activate Begin
...
.....
Label4.Caption:=FormatDateTime('MM:SS',Now); // Form Activate End
End;


After my form Appeared the result Was:

Label1.Caption:= 12:05
Label2.Caption:= 12:07

Label3.Caption:= 12:13
Label4.Caption:= 12:13


That's Strange!!!.....So as you can see OnShow Event takes only 2 second, and onActivate only takes Some MiliSeconds
BUT between Ending OnShow Event and Starting OnActivate Event what whould happen for my MDI-Child Form.?

Could Any one help? What's wrong with my Form?

Thanks In Advance.
Kind Regards.
Reply With Quote
  #2  
Old 05-30-2007, 10:22 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,059
Default RE: My Form takes a lot of time to appear....Could AnyOne help me.?

Are you using any other events?

Regards,
Abdulaziz Jasser
Reply With Quote
  #3  
Old 05-30-2007, 08:10 PM
ZarrinPour ZarrinPour is offline
Senior Member
 
Join Date: Jul 2003
Posts: 232
Default RE: My Form takes a lot of time to appear....Could AnyOne help me.?

I'm using only OnShow,OnActivate , OnCloseQuery And OnClose
events !!!

I'm Looking Forward to hearing From you Jasser
Regards.
Reply With Quote
  #4  
Old 05-30-2007, 10:19 PM
praveenkumar_k praveenkumar_k is offline
Senior Member
 
Join Date: Sep 2006
Posts: 698
Default RE: My Form takes a lot of time to appear....Could AnyOne help me.?

Can u give me ur on show event,

else r u creating anything in onshow event

like

loading DLL
Creating thread
events
mutex

or else creating any other forms or else
assigning values to any listview,treeview,listbox, memo

or checking any text files any thing else

??????????????

Hope this will help U

Have a nice & Peaceful Day My Friend

Regards
KPK
Mumbai
INDIA
Reply With Quote
  #5  
Old 05-30-2007, 10:20 PM
praveenkumar_k praveenkumar_k is offline
Senior Member
 
Join Date: Sep 2006
Posts: 698
Default RE: My Form takes a lot of time to appear....Could AnyOne help me.?

if u did anything which i listed above, then that process is taking time

Hope this will help U

Have a nice & Peaceful Day My Friend

Regards
KPK
Mumbai
INDIA
Reply With Quote
  #6  
Old 05-30-2007, 11:58 PM
ZarrinPour ZarrinPour is offline
Senior Member
 
Join Date: Jul 2003
Posts: 232
Default RE: My Form takes a lot of time to appear....Could AnyOne help me.?

Hi
To tell you the truth,in my OnShow event i only open two Datasets (one Master and another Detail) that are connected to two DBGrids on the form,the number of record of Master dataset is about 3000 records at most.
Also in my Onactivate i only use setfocus() function to set the focus of my form's components.....so as you can see
i don't do any special operation here. BUT that Delay(i mentioned earlier ,about 6 seconds) are bothering my customer and i don't know what should i do.

Any way thanks for following my case.
Regards.
Reply With Quote
  #7  
Old 05-31-2007, 01:21 AM
praveenkumar_k praveenkumar_k is offline
Senior Member
 
Join Date: Sep 2006
Posts: 698
Default RE: My Form takes a lot of time to appear....Could AnyOne help me.?

S that is the problem,

its taking time to load that 3000 records....

Hope this will help U

Have a nice & Peaceful Day My Friend

Regards
KPK
Mumbai
INDIA
Reply With Quote
  #8  
Old 05-31-2007, 04:54 AM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: My Form takes a lot of time to appear....Could AnyOne help me.?

If you have a dataset opening on the form don't make the dataset active. Instead be sure to use an adoquery to populate your dbgrid it will be much much faster than having an active table.

========================================
A point waiting for the correct answer.

thank you

Jon
Reply With Quote
  #9  
Old 05-31-2007, 06:46 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,059
Default RE: My Form takes a lot of time to appear....Could AnyOne help me.?

Opening the dataset is the problem. You can enhance the loading of the data by creating the right indexes if you are using a query with a certain criteria.

Regards,
Abdulaziz Jasser
Reply With Quote
  #10  
Old 05-31-2007, 11:19 AM
ZarrinPour ZarrinPour is offline
Senior Member
 
Join Date: Jul 2003
Posts: 232
Default Thanks you GUYS for following My case ..But your solutions didn't help

Thanks all of you for following my case
Kind Regards.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 10:23 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.