Form slow to render

Posted on 2005-04-10
Last Modified: 2010-04-05

I'm having problems with my applications's main form which is extremely slow to render when I go from minimize to maximize or change tabs. I'm using a ElPAgeControl (all client) and Eldos components and buttons on the tabs. It is even visually slow in the IDE. The EL coponents are all XP enabled but that does not seem to be the problem as I turned the XP off and it was still slow.

Would anybody know what the problem may be or if there are any tricks I can do to make it render faster? Right now you can see the components appear one by one as if you were loading a web page through a dialup connection.


Question by:mjcarter22
    LVL 15

    Expert Comment

    You could try setting the doublebuffered property of the form so that it renders it all in one go first before displaying.

    Author Comment


    Thanks for your response mikelittlewood

    I tried that and also set doublebuffered for all the other components. It helped a bit, but it still does the slow loading web page thing. It does not seem to load the entire Form before showing it. Is there anything else I need to set?

    Is there a way that I can make the form invisible and then make it visible when everything is fully painted? Is there an event that is triggered when the painting is completed?
    LVL 15

    Expert Comment

    Maybe you could render the form off screen at some obscure coordinates and then move to centre of screen after a period of time. Im not sure what else you could do. Maybe someone else has some ideas.

    As some possible tips, you should concentrate on drawing code optimization.
    If you have some preaparing code (loading bitmaps etc) you should put it into the OnCreate event (or OnShow as apropriate) leaving paint events as lightweight as possible.
    All painting happens only when it needs to be displayed - so when form is going to paint (when loading or restoring from minimized state), all controls are receving WM_PAINT message to paint on passed DC and all controls paints themselves one by one.
    LVL 15

    Expert Comment

    You could also possibly put this in your dpr to stop the main form showing for a period of time

    Application.ShowMainForm := False;

    then do

    Form1.Visible := true;
    Application.ShowMainForm := True;
    LVL 3

    Accepted Solution

    if it is visually slow in the ide
    then it shouldnt be your code.

    one possible way to identify what makes the form slow
    is to copy the whole project and then delete in copy one component after
    if the form is starting to get faster with each component then the
    components all are responsible for making it slower.
    but maybe there is one component that is the reason it
    takes so much time.

    Author Comment

    Thanks gandalf_the_white,

    You were  right. The ELPack components were the problem. I switched to an older hard drive that also had Delphi on it with an older version of ELPAck and it compiled fine. The GUI refreshed normally.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
    Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now