I have a Form MainForm which inherits DockContent and even registered the mousedown and keypress event in the initialization of form. But none of these events get triggered and really don't know what could be the reason.
Below is the code :
using WeifenLuo.WinFormsUI.Docking;
public partial class MainForm : DockContent
{
InitializeComponent();
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.MainForm_Load);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.MainForm_KeyPress);
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.MainForm_KeyUp);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.MainForm_MouseDown);
}
}
private void MainForm_MouseDown(object sender, MouseEventArgs e)
{
Copy.Show(Cursor.Position);
}
On the right or left click on form i want to show context menu with item "Copy". But mousedown event or even the keypress event does not trigger.