Okay, well that makes sence since the issue will be that the transparent form
and the controls will be using the main UI thread to update, since the form
is resizing and taking most of the processing time the other controls do not
get chance to update.
What you can do is create your transparent form on a new thread and use that
thread as the message pump thread for the transparent form, then you will not
be tying up the main UI thread of your app when you resize. I think this may
work for you, try out something like the following:
private void btnShowForm_Cli ck(object sender, EventArgs e)
{
//Make sure only do this once. This thread is going to create the
//transparent form and be its message pump thread.
Thread t = new Thread(new ThreadStart(Cre ateOverlayForm) );
t.IsBackground = true;
t.Start();
}
//The form which is going to be transparent;
Form transparentForm = null;
void CreateOverlayFo rm()
{
//Create the transparent form
transparentForm = new Form();
transparentForm .Opacity = 0.1;
//Run the for on this thread creating a new message pump on the
//calling thread.
Application.Run (transparentFor m);
}
private void btnHideForm_Cli ck(object sender, EventArgs e)
{
//Only hide the form so we can reuse it later
HideTransparent Form();
}
private void HideTransparent Form()
{
//Make sure we call the hide method in the context of the thread
//that created the form.
if (this.transpare ntForm.InvokeRe quired)
{
this.transparen tForm.Invoke(ne w MethodInvoker(H ideTransparentF orm));
}
else
{
//This is the thread that created the form, safe to update
this.transparen tForm.Hide();
}
}
Hope that helps (or works :-))
Mark.
--
http://www.markdawson.org
"Ajith Menon" wrote:
Mark R. Dawson wrote:
What kind of degredation are you seeing? I set a form to 10% opacity and was
playing a video in my web browser, playing music with a visualization playing
and everything played fine while resizing the form, the CPU was at 100% but
that is okay. I was also running the app in debug mode, my laptop is not
great only 1.8GHz and 768MB of RAM.
Mark.
I have this transparent form within other application which has many
other forms. The other forms get dynamic data and gets updated
regularly. These other forms of the same application starts degrading
i.e. the dynamic data stop coming on it.