I've brought it up in the past, but I feel compelled to make an issue of it again. Windows Forms is sorely lacking what is known in the VB6 world as "light-weight controls," or, controls that don't own their own window, and instead share their parent's window.
The reason that I bring this up is because I am writing a program that includes calculator functionality, and am basing my calculator loosely on the Calc.exe program included with Windows. You know the one, with lots and lots of buttons. With only a fraction of my buttons in place, the price I pay for having that many windows becomes abundantly clear. In the ballpark of 25 buttons, with each redraw, I can see each button being drawn as the form takes image painfully slowly. This is on my laptop, and I'm sure that there would be quite a difference on my desktop, but the fact is that my program will be used on, at least, my own laptop if not others.
I wrote my own LightweightControl class, which I inherited to create a LightweightButton class. At this point both of the two are very far from finished, but the drawing speed seems to be an order of magnitude faster, and visually indistinguishable. Before I put hours (or, more likely, days) of effort into writing complete light-weight controls (which could never be supported by the designer...) I was wondering if anyone else has run into this type of problem and what other approaches have been taken to solve it.
The reason that I bring this up is because I am writing a program that includes calculator functionality, and am basing my calculator loosely on the Calc.exe program included with Windows. You know the one, with lots and lots of buttons. With only a fraction of my buttons in place, the price I pay for having that many windows becomes abundantly clear. In the ballpark of 25 buttons, with each redraw, I can see each button being drawn as the form takes image painfully slowly. This is on my laptop, and I'm sure that there would be quite a difference on my desktop, but the fact is that my program will be used on, at least, my own laptop if not others.
I wrote my own LightweightControl class, which I inherited to create a LightweightButton class. At this point both of the two are very far from finished, but the drawing speed seems to be an order of magnitude faster, and visually indistinguishable. Before I put hours (or, more likely, days) of effort into writing complete light-weight controls (which could never be supported by the designer...) I was wondering if anyone else has run into this type of problem and what other approaches have been taken to solve it.