user128873
user128873

Reputation: 83

.net compact framework button override OnPaint

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

Answers (2)

argh
argh

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

user128873
user128873

Reputation: 83

Set control's style to UserPaint - problem fixed

Upvotes: 0

Related Questions