日期:2014-05-17 浏览次数:20797 次
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public Form2 m_frm2=null; //天气窗体
private void Form1_Load(object sender, EventArgs e)
{
this.MouseMove += Form1_MouseMove;
}
void Form1_MouseMove(object sender, MouseEventArgs e)
{
this.Text = e.X + "," + e.Y;
if (m_frm2 != null)
return;
if (e.X > 100 && e.Y > 100 && e.X < 200 && e.Y < 200) //主窗体(Form1)鼠标进入[100,100]-[200,200]区域显示天气窗体(Form2)
{
m_frm2 = new Form2();
m_frm2.m_frm1 = this;
m_frm2.Show();
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form2 : Form
{
public Form2()
{
Ini