111,130
社区成员
发帖
与我相关
我的任务
分享public Form1()
{
InitializeComponent();
this.Deactivate += new EventHandler(Form1_Deactivate);
}
void Form1_Deactivate(object sender, EventArgs e)
{
this.Close();
//this.Hide();
}
public Form4()
{
InitializeComponent();
Timer T = new Timer();
T.Interval = 100;
T.Tick += new EventHandler(T_Tick);
T.Enabled = true;
}
void T_Tick(object sender, EventArgs e)
{
if (!this.Bounds.Contains(Control.MousePosition))
Text = Control.MousePosition.X.ToString();
//Close();
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication291
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Timer T = new Timer();
T.Interval = 100;
T.Tick += new EventHandler(T_Tick);
T.Enabled = true;
}
void T_Tick(object sender, EventArgs e)
{
if (!this.Bounds.Contains(Control.MousePosition)
&&Control.MouseButtons==MouseButtons.Left )
Close();
}
}
}