473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Freeze GUI

Hi NG!
I have a panel which acts as a container for different usercontrols.
Depending on the current state the corresponding usercontrol is
displayed. If I change the state, I remove the current usercontrol from
the panel and add the new one.
During initializing the new usercontrol the panel shows some textbox
component boarders of the removed usercontrol, which does not look very
nice. How can I freez the GUI or the panel and only call a repaint
after the initializing process ?
I tried with Suspend- and ResumeLayout, but this does not work.
Thanks and regards
Marcel

Aug 21 '06 #1
4 2922
Hi,
Have you tried the Invalidate() or Refresh() methods of your panel?
You could implement the swapping functionality inside your usercontrol
so these are called automatically when the swap is made. I would still
use SuspendLayout() and ResumeLayout() aswell...

Cheers,
James.

schaf wrote:
Hi NG!
I have a panel which acts as a container for different usercontrols.
Depending on the current state the corresponding usercontrol is
displayed. If I change the state, I remove the current usercontrol from
the panel and add the new one.
During initializing the new usercontrol the panel shows some textbox
component boarders of the removed usercontrol, which does not look very
nice. How can I freez the GUI or the panel and only call a repaint
after the initializing process ?
I tried with Suspend- and ResumeLayout, but this does not work.
Thanks and regards
Marcel
Aug 21 '06 #2
Hi pigeonrandle:
Have you tried the Invalidate() or Refresh() methods of your panel?
Does invalidate not force the redrawing ? During the initializing time
my panel looks not nice. So I would like to keep the old usercontrol UI
freezed on the screen during this time. after the new usercontrol is
loaded and initialized i would like to show this one.
You could implement the swapping functionality inside your usercontrol
so these are called automatically when the swap is made.
I have it. With each state transition my new usercontrol is
automatically loaded. Or what do you mean?

Thanks

Aug 21 '06 #3


In some "extreme" cases I use the Win32 "LockWindowUpdate()"...
(! You can Lock only one control at a time. Locking an second control will
Unlock the previous locked one)
public class TWinFct
{
[DllImport("user32")]
private static extern int LockWindowUpdate(IntPtr hwndLock);
public static int LockControlUpdate(Control AControl)
{
return LockWindowUpdate(AControl.Handle);
}

public static int UnLockControlUpdate()
{
return LockWindowUpdate(IntPtr.Zero);
}
}

usage :

{
//Lock Control update
TWinFct.LockControlUpdate(MyControl)
//.... do things
//Unlock Control update
TWinFct.UnLockControlUpdate()
}
Steph.

"schaf" <sc***@2wire.chwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
Hi NG!
I have a panel which acts as a container for different usercontrols.
Depending on the current state the corresponding usercontrol is
displayed. If I change the state, I remove the current usercontrol from
the panel and add the new one.
During initializing the new usercontrol the panel shows some textbox
component boarders of the removed usercontrol, which does not look very
nice. How can I freez the GUI or the panel and only call a repaint
after the initializing process ?
I tried with Suspend- and ResumeLayout, but this does not work.
Thanks and regards
Marcel

Aug 21 '06 #4

schaf wrote:
Hi pigeonrandle:
Have you tried the Invalidate() or Refresh() methods of your panel?
Does invalidate not force the redrawing ? During the initializing time
my panel looks not nice. So I would like to keep the old usercontrol UI
freezed on the screen during this time. after the new usercontrol is
loaded and initialized i would like to show this one.
You could implement the swapping functionality inside your usercontrol
so these are called automatically when the swap is made.
I have it. With each state transition my new usercontrol is
automatically loaded. Or what do you mean?
My first question would be: what is the program doing while the UI is
frozen? Perhaps there is some initialization code in your user control
that is taking a lot of time?

If that code is in the constructor then it's easy: just instantiate the
new user control before you start removing the old user control.

If that code is in the Load method (which is where it should be), then
it's a little more difficult: you have to use a background thread to do
the work, so that the UI can update itself.

So... what is going on in the initialization stages of your user
control that is taking so much time?

Aug 21 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: aww91 | last post by:
Company is planning a Sybase to UDB migration that is projected to take 1 year. During that long period of time any Code Freeze put into place would impact our users (we normally release code...
11
by: Timothy Shih | last post by:
Hi, I am having a freezing issue with my application. My application serves several remotable objects, all of which must be initialized before their use. Furthermore, some of them depend on each...
2
by: mrstephengross | last post by:
I'm working with the freeze utility, and I'm trying to learn the basics. For the most part, I think I understand how it works. I have a question about modules, though. I want to make sure that...
4
by: Roger Withnell | last post by:
I would like to freeze column and row headings on a webpage, simulating freeze panes as in an Excel spreadsheet. Don't seem to be able to do it with Frames. Is there a way with Javascript...
2
by: paraidy | last post by:
Hi all, i would to know how is possible to freeze another process from my application and unfreeze it, can someone help me? thx all.
1
by: jmalone | last post by:
I have a python script that I need to freeze on AIX 5.1 (customer has AIX and does not want to install Python). The python script is pretty simple (the only things it imports are sys and socket)....
1
by: Cameron Laird | last post by:
How is Freeze--freeze.py <URL: http://wiki.python.org/moin/Freeze >--packaged for Debian? *Is* it packaged for Debian?
4
by: ToxSox | last post by:
Hello. This is my first post here and i have a big problem with my script! One page (child.htm), was delivered not by me and i can't change it. This page calls a methode in a object of my page....
6
by: Mike Kent | last post by:
In a comment Guido made on a recent bug report for the 'freeze' utility, he stated: "I think nobody really cares about freeze any more -- it isn't maintained." That being the case, what is...
2
by: Gabriel Rossetti | last post by:
Hello everyone, I'm trying to use python's freeze utility but I'm running into problems. I called it like this : python /usr/share/doc/python2.5/examples/Tools/freeze/freeze.py...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.