Inheriting a Base Form but Paste/Cut Commands Not Captured
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.
精彩评论