By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,723 Members | 1,185 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,723 IT Pros & Developers. It's quick & easy.

Something more performant than Hide and Show control method?

P: n/a
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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.