-1

I am working with windows application i have removed maximized property to all windows. My doubt is how to fix the windows only upto toolbar in windows 8.

I have verified the below link: Didn't Resolve my problem

How to fit Windows Form to any screen resolution?

Check The Image

enter image description here

Community
  • 1
  • 1
Dinesh Reddy Alla
  • 1,677
  • 9
  • 23
  • 47
  • Maybe use WPF instead (check out viewBox), gives you more control. If you need to stick with WinForms, use Dock and Anchor. Containers like SplitContainer and Panels can be resized properly with the Dock property, though controls like buttons, labels are harder to size. – aggaton Nov 10 '15 at 05:35
  • How do you set the window size? I set the size this way `this.Location = new Point(0, 0); this.Size = Screen.PrimaryScreen.WorkingArea.Size;` and it works properly. – Reza Aghaei Nov 10 '15 at 06:05
  • As another option you can set t he window size this way: `this.WindowState = FormWindowState.Maximized; this.MaximizeBox = false;` – Reza Aghaei Nov 10 '15 at 06:10
  • Let me know if these codes fixed the problem or if you can share a code to reproduce the problem :) – Reza Aghaei Nov 10 '15 at 06:37
  • Hi @RezaAghaei what you have send i alredy implemented. Your code works for Maximized but check the image what i have attached with question. – Dinesh Reddy Alla Nov 10 '15 at 08:51
  • Hi @Dineshalla , I implemented both solutions and it works properly, I think its better to share your code and the evant that you run this code, and your forms important properties like `WindowState`, `FormBorderStyle` – Reza Aghaei Nov 10 '15 at 08:55
  • @Dineshalla Could you share what I said in previous comment to reproduce the problem? Without sharing the code and settings the problem can't be solved. – Reza Aghaei Nov 10 '15 at 10:47

2 Answers2

0

You have to maximize the form in order for it to fit to any screen resolution

Juran
  • 177
  • 1
  • 8
0
public Form1()
{
    InitializeComponent();
    this.WindowState = FormWindowState.Normal;
    this.StartPosition = FormStartPosition.Manual;
    this.Size = Screen.PrimaryScreen.WorkingArea.Size;
}
Dinesh Reddy Alla
  • 1,677
  • 9
  • 23
  • 47