开发者

Inheriting a Base Form but Paste/Cut Commands Not Captured

开发者 https://www.devze.com 2023-01-03 09:06 出处:网络
I created a base form that has a specific size and an icon as a base for all form开发者_运维技巧s created in my project (to be consistent in looks). The problem is, for some reason if I add a Text box

I created a base form that has a specific size and an icon as a base for all form开发者_运维技巧s created in my project (to be consistent in looks). The problem is, for some reason if I add a Text box to the Child form, I can no longer execute shortcuts like Copy (CTRL+C) etc into the Textbox.

What should I do to handle this OTHER THAN writing code to capture those on the KeyUp control?

This is also the case for RichTextBox control as well.

Thanks


I am not able to replicate your problem. But I would suggest that is better to avoid inheritance, check Microsoft Application Architecture Guide, 2nd Edition for details

Prefer composition to inheritance. Wherever possible, use composition over inheritance when reusing functionality because inheritance increases the dependency between parent and child classes, thereby limiting the reuse of child classes. This also reduces the inheritance hierarchies, which can become very difficult to deal with.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号