472,110 Members | 2,075 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Something more performant than Hide and Show control method?

I have a full custom application with some widged extending Controls
like Label and PictureBox. I build a menu with these widgets. When
I click on one of them, it calls a function to display some stuff in
the main display area.

The stuff to display is one of many assemblies loaded at the opening
of the application by Activator.CreateInstance, because I want it
independant of the main application, as a plugin. All assembly are
loaded in the same Panel Control (with transparent background). Each
of these assembly have a Hide and Show method, and inside these method
I call the original Hide and Show method for each custom widget (Label
Controls) contained in the assembly. At the opening all is set to
hide in the Panel.

I doublebuffered the constructor of each widget that extending control
(the Panel, the Label and PictureBox) with :
// Set this style properties
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);

So the problem is when I click on one of my widget in my menu, it's
suppose to call Invoke the Show function of my assemblies to display
the selected one. By clicking another widget, it Hide the current
one and show the new selected one. But it's slow!!!! I have to
wait maybe 100 ms before display the new image and text. Since we
know all my assembly are loaded, and the only function call is Hide
and Show on my controls, can we conclude that Hide and Show are non
performant?

By adding the DoubleBuffer properties, I at least double the display
performance, but it's not enough

Is there something to do to override the Hide
and Show functions?

Maybe another solution is to load one assembly on one Panel with a
non-transparent background, and BringToFront the selected assembly?
Is BringToFront more performant than Hide and Show?

Thank you
Francois

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 16 '05 #1
0 1890

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post: by
reply views Thread by leo001 | last post: by

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.