Reputation: 83
I am writing an application for the .NET Compact Framework.
If a create a new custom control inheriting Control class MyButton : Control
, my OnPaint override gets called correctly.
However, if I create a new custom control inheriting Button class MyButton : Button
- it does not.
Why does the OnPaint override not work when inheriting from Button?
Any help would be appreciated.
Upvotes: 0
Views: 1769
Reputation: 931
To be able to override OnPaint in Button you needUserPaint style set on Button... and you can't do that in compact framework bacause it's not supported there. The only way to do it is to write your own controls from the ground up.
Upvotes: 1