public Form2 b = new Form2();
private void Form1_Load(object sender, EventArgs e)
{
this.ShowInTaskbar = false;
contextMenuStrip1.Visible = false;
b.Show();
} private void timer1_Tick(object sender, EventArgs e)
{
do{label2.Text=MousePosition.ToString();}
while(timer1.Interval == 5);
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.F1 && this.Visible == true)
{
int a, c;
a = MousePosition.X;
c = MousePosition.Y;
if (MessageBox.Show(null, "确定定位为" + MousePosition.ToString(), "定位", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
b.StartPosition = FormStartPosition.Manual;
b.Location = new System.Drawing.Point(a, c);
}
}
if (e.KeyCode == Keys.F12 && this.Visible == true)
{
timer2.Enabled = true;
}
if (e.KeyCode == Keys.F3 && this.Visible == true)
{
Form c3=new Form3();
c3.Show(); }
}
private void timer2_Tick(object sender, EventArgs e)
{
this.Visible = false;
} private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (Location.X==220&&Location.Y==260)
{
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Location = new System.Drawing.Point(1330-220, 768-260);
this.Show();
}
else
{
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Location = new System.Drawing.Point(220, 260);
this.Show();
} } private void 开始定位ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Visible = true;
timer2.Enabled = false;
}
private void 隐藏ToolStripMenuItem_Click(object sender, EventArgs e)
{
timer2.Enabled = true;
} private void 退出ToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (MessageBox.Show(null, "是否确定退出","您好", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
Application.Exit();
}
} private void 退ToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("您好这里是lutassy,当开始定位时,F1定位,F3进行设置,F12退出定位.");
}
}
private void Form1_Load(object sender, EventArgs e)
{
this.ShowInTaskbar = false;
contextMenuStrip1.Visible = false;
b.Show();
} private void timer1_Tick(object sender, EventArgs e)
{
do{label2.Text=MousePosition.ToString();}
while(timer1.Interval == 5);
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.F1 && this.Visible == true)
{
int a, c;
a = MousePosition.X;
c = MousePosition.Y;
if (MessageBox.Show(null, "确定定位为" + MousePosition.ToString(), "定位", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
b.StartPosition = FormStartPosition.Manual;
b.Location = new System.Drawing.Point(a, c);
}
}
if (e.KeyCode == Keys.F12 && this.Visible == true)
{
timer2.Enabled = true;
}
if (e.KeyCode == Keys.F3 && this.Visible == true)
{
Form c3=new Form3();
c3.Show(); }
}
private void timer2_Tick(object sender, EventArgs e)
{
this.Visible = false;
} private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (Location.X==220&&Location.Y==260)
{
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Location = new System.Drawing.Point(1330-220, 768-260);
this.Show();
}
else
{
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Location = new System.Drawing.Point(220, 260);
this.Show();
} } private void 开始定位ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Visible = true;
timer2.Enabled = false;
}
private void 隐藏ToolStripMenuItem_Click(object sender, EventArgs e)
{
timer2.Enabled = true;
} private void 退出ToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (MessageBox.Show(null, "是否确定退出","您好", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
Application.Exit();
}
} private void 退ToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("您好这里是lutassy,当开始定位时,F1定位,F3进行设置,F12退出定位.");
}
}