Solved

Conditional Creation of Visual Components

Posted on 2002-07-16
5
157 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Send message from delphi to whatsapp, is it possible? 3 1,426
find a node in VST 2 68
Delphi inherited method 6 68
Tvertscrollbox like a whatsapp layout delete messages 1 16
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 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