1

I have set my form to be full screen and trying to get the width and the height as an integer. I have been looking for the past hour but can't seem to get an answer. In Java its a simple JFrame.getwidth(); but no so simple for c#?

using windows forms

Mohit S
  • 13,723
  • 6
  • 34
  • 69
wardas23
  • 79
  • 9
  • So your form is now full screen and you want to know how wide it is correct? Surely that is just `Width` / `this.Width` – amg-argh Nov 17 '15 at 01:53
  • no that doesn't seem to work I'm trying to set a few images the same width as my form and using that somehow is making it smaller – wardas23 Nov 17 '15 at 01:57

1 Answers1

4

The Screen can help you to get the size.

Screen.PrimaryScreen.Bounds.Width;
Screen.PrimaryScreen.Bounds.Height;
Screen.PrimaryScreen.Bounds.Size;

You can also have a look on How to retrieve the Screen Resolution from a C# winform app?

Community
  • 1
  • 1
Mohit S
  • 13,723
  • 6
  • 34
  • 69