Are your buttons sitting on a form that has a BackgroundImage?
You'll find the same behaviour with 40 standard buttons.
I just placed 60 buttons on a form and it loaded immediately on my 2Ghz
machine.
Mick:
(I apologize for calling you Mike in an earlier post.)
My buttons are indeed sitting on a form that has a BackgroundImage.
By your second sentence, are you saying that even standard buttons will draw
slowly over a form with a BackgroundImage? That's not what I'm seeing. If I
change the FancyButtons in my form to System.Windows.Forms.Buttons, the form
goes from taking two seconds to draw, to drawing in one or two tenths of a
second. Standard buttons do not draw slowly over a form with a background
image. But that also seems to be what you are saying in your third sentence.
With my FancyButtons, if I remove the BackgroundImage from the parent form, I
am back to acceptable performance, i.e. the form displays in one or two tenths
of a second. It's not so fast that I can't see the screen being drawn, but
it's probably fast enough.
But the customer really did want that background image. Really, this is just
not a limitation that I would have expected from Windows Forms.
Are you suspicious that I have an implementation problem that is causing the
bad performance? I am still willing to plug your button code in and see how it
does.
Tim Crews
GECO, Inc.