Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Conditional Creation of Visual Components

Posted on 2002-07-16
5
Medium Priority
?
162 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 150 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

670 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