Panel SLOW

anthony.selby

Well-known member
Joined
Sep 3, 2009
Messages
65
Programming Experience
5-10
I'm using a winform with a panel on it ... in that panel I have 240 buttons ... that panel is normally hidden ... but sometimes I show it ... panel1.show
panel1.bringtofront ... but I've noticed even on fast machines ... it doesn't come up smooth ... i can actually see it draw the different buttons ... anyone have any ideas ?

i do have doublebuffering turned on for the form
 
Last edited:
240 buttons? I cant even imagine the need for a design like that. My first thought would be to wonder if there was a better way to achieve your goals without so many buttons. I would imagine it would take a lot of time for the screen to draw that many controls at once. Without more details and/or an example of it, its hard to offer any advice on how to improve its performance. If you can provide a sample, I'll take a look for you.
 
Its for a touch screen program I'm writing ... a chiropractic program ... most of the major muscle groups are on the screen ... and they touch the ones they treat .... I made a test app with WPF ... and it doesn't have the problem ... I don't want to redo the entire thing if I dont have to

what kind of example would you like ? I can post a screen shot if that would help ... but I have a tab control that when the tab index changes to 4 I display this panel on the form (not in the tab control)
 
It is necessary to display everything at once, perhaps it would be easier to find things if you divided up into major body parts first?

Painting stuff yourself and hittest clicking on form is also a possibility. The reason one would see difference between Forms and WPF with many controls is because WPF is painted as a single surface while in Forms each control is painted independently as a separate window. There are also other differences, see for example Differences Between GDI And WPF. In Vista GDI painting is arranged differently and should give better performance.
 
Back
Top