Solved

Conditional Creation of Visual Components

Posted on 2002-07-16
5
160 Views
Last Modified: 2010-04-04
Hello,
I have this situation.
A form in which Activate event, depending on some configuration, a panel that contains some controls is hiding, making it invisible.
The panel is align OnTop, so i need to resize the form, recenter it in the screen.
That works ok, and you see a little blinking. But, when you run the proyect in slow machines, you see a large movement in the screen.
Here is the question...
Can i do all the task at the OnCreate event?
I had trouble by resizing the form at that level, and the configuration variable cannot be read if it belongs to the form unit.
Thanks you all...
0
Comment
Question by:spk2000ar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 7

Expert Comment

by:Cynna
ID: 7156786
I'm not sure I got you right, but you might try
moving your code to OnFormShow event.
If that yields better results, just use flag (for example, global var AlreadyShowed) to prevent your code from executing whenever the form is showed...
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 7156793
Alos try setting Form.DoubleBuffered to True.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7156806
>Can i do all the task at the OnCreate event?
should work,
can you show your tries?
0
 

Accepted Solution

by:
RayNorrish earned 50 total points
ID: 7178664
To stop "flicker" when altering a window try:

   LockWindowUpdate(Self.Handle);

 // do your resize/recentre

   LockWindowUpdate(0);

This will stop any repainting of the form while you move stuff around.

Of course .. the "flicker" on a slow machine could be down to a poor graphics adapter as well.

I also agree to move the code to the onShow event, as your other components may not be created / available in the form's onCreate event.
0
 
LVL 4

Author Comment

by:spk2000ar
ID: 7181262
Sorry about the delay...
I will accept RayNorrish answer because is the most accuratte.
But, Cynna, please i will send another question to adjust points (25) to give you that answer... answer it, for me to accept it.
Thanks you all...
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 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