Check for the screen resolution.
i want that the applicaton i'v created in visual studio using c# to check the screen resolution that is running on the client computer before it runs,if the screen resoluton is less than 1366*768 than i want my program to say that the screen resolution is too small.and stop executing.
Sanjeeb LenkaPosted Aug 24, 2013, 1:08 AM
Refer to this link
http://tutorials.csharp-online.net/Retrieve_the_current_screen_resolution
The C# code snippet below retrieves the screen resolution of the system.
using System.Windows.Forms;//namespace
int deskHeight = Screen.PrimaryScreen.Bounds.Height;
int deskWidth = Screen.PrimaryScreen.Bounds.Width;
MessageBox.Show("Your screen resolution is " + deskWidth + "x" + deskHeight);
StarkPosted Aug 24, 2013, 1:24 AM
Sanjeeb LenkaPosted Aug 24, 2013, 1:17 AM
int deskHeight = Screen.PrimaryScreen.Bounds.Height;
int deskWidth = Screen.PrimaryScreen.Bounds.Width;
if (deskWidth < 1366 && deskHeight < 768)
{
MessageBox.Show("too low screen resolution");
}
Sanjeeb LenkaPosted Aug 24, 2013, 1:07 AM
Refer to this link
http://tutorials.csharp-online.net/Retrieve_the_current_screen_resolution
The C# code snippet below retrieves the screen resolution of the system.
using System.Windows.Forms;//namespace
int deskHeight = Screen.PrimaryScreen.Bounds.Height;
int deskWidth = Screen.PrimaryScreen.Bounds.Width;
MessageBox.Show("Your screen resolution is " + deskWidth + "x" + deskHeight);
StarkPosted Aug 24, 2013, 1:05 AM
Iftikar HussainPosted Aug 24, 2013, 12:56 AM
You can try like this
var width = parseInt(screen.width);
Regards,
Iftikar