简体   繁体   中英

.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.

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.

将控件的样式设置为UserPaint-已修复问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM