Dark Knight
Dark Knight

Reputation: 3577

how to show complete window when screen resolution changed C#

I have a WinForm,when the its size is 700x700,when I change the screen resolution of the system from 1366x768 to other(like 800x600),only part of the window is visible.How can I make it fully visible? what property of the form i have to change?

Upvotes: 3

Views: 334

Answers (2)

ba__friend
ba__friend

Reputation: 5903

You will want to adjust the Bounds property of your form. Screen.PrimaryScreen can support you to get the new right size.

Upvotes: 0

Jodrell
Jodrell

Reputation: 35716

I would say would say you want to adjust your Form.Size and Form.Location to fit within the Screen.GetWorkingArea(). You will want to do that when the event Microsoft.Win32.SystemEvents.DisplaySettingsChanged is fired. As in this answer.

Upvotes: 2

Related Questions