Page 1 of 1

Monitor calibration on PC runtime

Posted: Mon Jan 26, 2015 9:35 am
by Chris D
How can I get the information, if a mousebutton is pressed, while the runtime is starting?
I would like to implement a service menu for pc runtime similiar to the panels.
I need to calibrate a new monitor. In the OnLoad Event of the startup page I would like to do
if ( MouseButtons == MouseButtons.Left)
{
}

Greetings Chris

Re: Monitor calibration on PC runtime

Posted: Fri Jan 24, 2020 1:43 pm
by Russ C.
You can capture a mouse click by hooking up the MouseDown event and the MousePosition.X and MousePostion.Y properties.

Code: Select all

void Screen2_Opened(System.Object sender, System.EventArgs e)
		{
			MouseDown+= myMouseClick;
		}

		void myMouseClick(System.Object sender, System.Windows.Forms.MouseEventArgs e)
		{
			MessageBox.Show(MousePosition.X+","+ MousePosition.Y);
		}
		
		void Screen2_Closed(System.Object sender, System.EventArgs e)
		{
            MouseDown-= myMouseClick;
		}