Minimum Screen Size To Design For

Netbooks often use 1024 x 600 screen resolution.
Windows 7 taskbar is 40 pixels high (?), however a netbook user is likely to set the taskbar to auto hide.

Single Monitor Systems


	int height = Screen::PrimaryScreen->Bounds.Height;
	int width = Screen::PrimaryScreen->Bounds.Width;

	Screen ^PrimaryScreen = Screen::PrimaryScreen;
	this->Width = PrimaryScreen->WorkingArea.Width;

Multiple Monitor Systems


	int monitors = Screen::AllScreens->Length;
	int height = Screen::AllScreens[0]->Bounds.Height;
	int width = Screen::AllScreens[0]->Bounds.Width;
Get The Current Screen Details – The Screen A Form Is On

	Screen ^OurScreen = Screen::FromControl(this);
	int height = OurScreen->Bounds.Height;
	int width = OurScreen->Bounds.Width;

Coordinates / Determining Screen Used

Top left of the primary screen is 0,0
If there are multiple monitors and a screen is to the left then its Left coordiante will be negative.
Therefore this makes it simple to ensure that your applicaiton appears on a primary monitor or to detect if you application is on a seconday monitor (Left < 0 or Left > Primary screen width)

Good resource:
http://www.codeproject.com/KB/miscctrl/multimonformlocations.aspx

Reading Details Of All System Screens


	int index;
	int upperBound;

	// Gets an array of all the screens connected to the system.
	array^screens = Screen::AllScreens;
	upperBound = screens->GetUpperBound(0);
	for (index = 0; index <= upperBound; index++) 	{ 		// For each screen, add the screen properties to a list box. 		listBox1->Items->Add(String::Concat("Device Name: ", screens[index]->DeviceName) );
		listBox1->Items->Add(String::Concat("Bounds: ", screens[ index ]->Bounds));
		listBox1->Items->Add(String::Concat("Type: ", screens[ index ]->GetType()));
		listBox1->Items->Add(String::Concat("Working Area: ", screens[index]->WorkingArea));
		listBox1->Items->Add(String::Concat("Primary Screen: ", screens[index]->Primary));
	}
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *