简体   繁体   中英

C# WndProc event handler

I added a form control to my form in a designer. But I need to override that control's WndProc. Can I do that without creating a new control extending the old one? Because when I extend the old one like this my designer won't work anymore:

partial class ThatControlWithWndProc : TheControlIActuallyWant {}

Or how can I get my designer to work with this new control that I created and not throw me an error?

如果您只是直接编辑.Designer.cs文件以引用覆盖的控件,并确保它遵循控件与设计者兼容的规则(例如具有默认构造函数,而不依赖于任何其他初始化),则应该精细。

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