Iam looking for some hint or solution regarding following problem.
I have a .NET 2.0 WinForm dialog which operates in Dual Screen environment. The Working area is se
Combine the 2 screen sizes and set your form to that resolution. Something like:
int height = 0;
int width = 0;
foreach (screen in System.Windows.Forms.Screen.AllScreens)
{
//take smallest height
height = (screen.Bounds.Height <= height) ? screen.Bounds.Height: height;
width += screen.Bounds.Width;
}
Form1.Size = new System.Drawing.Size(width, height);
To override the maximize button you can check via WndProc for the maximize event
const int WM_SYSCOMMAND= 0x0112;
const int SC_MAXIMIZE= 0xF030;
protected override void WndProc(ref Message m)
{
if(m.Msg==WM_SYSCOMMAND)
{
if((int)m.WParam==SC_MAXIMIZE)
{
MessageBox.Show("Maximized!!");
return;
}
}
base.WndProc (ref m);
}
or register to the Resize event of the form (you should check if it's resize or an maximize) (MSDN)