I've written a frame application, it's a basic form of a Windows Forms app. When it starts, then load it into DLS / module and extension and when I click on the menu item as a parent, the specific DLL will work. If DLL is a form application, then it will be shown. But when I try to use shortcuts (build-ins only, such as: CTRL-C ...) Farm, hotkeys do not work. Anybody please tell me how and how can I fix this issue? Here is my code:
// parent.exe - module entrepreneur cs public abstract class module environments {public abstract string [] GetMenuNames (); Public abstract string [] GetMenuItemNames (); Public Essence EventHandler [] GetEventHandlers (); } //parent.exe --ParentForm.cs Public Partial Category MDIParent: Form {Public MDIParent () {// CTOR InitializeComponent (); Module entry anenture; String onename, one menu item name; Toolstrip menu item menu, menu item; For () {// In the recurring DLS / module, if this module applies environments, then load it. // and 1) Load menus and menus etc. 2) Connect to the handler // // lt.code: via the menuItem.Click: theMenuItem.Click + = New EventHandler (oneEntrance.GetEventHandlers () [i]); & Gt; }} // -------------- //child.dll-- Apply EnixiPCS // AC Public Class Entrepreneur IM: Module Entertainment {Public Override String [GetMenuNames} {New String [ ] {"Menu"}; } Public override string [] GetMenuItemNames () {Return new string} ["OpenChildForm"}; } Public override event handler [] GetEventHandlers () {Return to new event handler} [[EventHandler] Representative (Object Sender, EventAgds E) {// Anonymous Method Child Form = New Child Form (); // Find MDIparent and connect them with ToolStripMenuItem mi = (ToolStripMenuItem) sender; Form.MdiParent = (form) (mi.OwnerItem.Owner.Parent); // This works! Form.Show (); }}; }} //child.dll--childForm.dll // ...
There is some way to inform about key-down events in the child's form.
One way to do this is to reveal the child's form below and below incidents that can be heard as parents. Every time you change the hair form, remember to remove the parent event handlers, or you will end up with the memory leak because the objects are not collected garbage, unless you release all those references. , Which includes event handlers.
class guardian {KeyEventHandler KeyDownHandler; Public Generator () {KeyDownHandler = New KeyEventHandler (form_TextBoxKeyDown); } Zero set Childford (Child Form) {form.TextBoxKeyDown + KeyDownHandler; } Zero Exit Dillform (Child Form) {form.TextBoxKeyDown - = KeyDownHandler; } Zero form_TextBoxKeyDown (Object Sender, KeyEventArgs e) {if (e.Control) {Switch (e.KeyCode) {Case Keys.C: break; Case Keys.X: Break; Case key V: Break; }}}} Class child {text box txtBox; Event of Event Event Handler Text BoxKidown; Internal Hair () {txtBox.KeyDown + = New KeyEventHandler (txtBox_KeyDown); } Zero TxtBox_KeyDown (Object Sender, KeyEventArgs e) {If (TextBoxKeyDown! = Faucet) TextBoxKeyDown (Sender, E); }}
Comments
Post a Comment