I have a problem when I open the designer in Visual Studio for my form
The method 'dragScreen_MouseDown' cannot be the method for an event because a class this class derives from already defines the method.
Only thing I changed was adding a new class named FormBase
and get the methods from that class to other forms. Works fine, but designer does not seem to like it.
So in FormBase.cs
i got this method:
protected void dragScreen_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
}
Then in Main.cs
inherit form FormBase.
In the designer it like this:
this.button6.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dragScreen_MouseDown);
class FormBase : Form1
? – kwyntes