【发布时间】:2020-07-08 03:50:56
【问题描述】:
我希望我的 Windows 窗体应用程序在我的鼠标和键盘不活动 2 分钟时向我显示消息,有人可以帮助我吗?
我有用 C# 编写的 WinForms 应用程序。现在是医生应用程序的时间,我希望我的应用程序在两分钟未使用鼠标和键盘时向我显示消息。
SqlConnection conn = new SqlConnection(@"Data Source=DESKTOP-CVVIN92;Initial Catalog=PizzaShop;Integrated Security=True");
for(int i=0; i < dataGridsorder.Rows.Count; i++)
{
SqlCommand cmd=new SqlCommand(@"INSERT into Orders(Customer,Mobile,Date,MainType,SubType,OrderType,Discount,Net_Total) VALUES('"+dataGridsorder.Rows[i].Cells[0].Value+ "','" + dataGridsorder.Rows[i].Cells[1].Value + "','" + dataGridsorder.Rows[i].Cells[2].Value + "','" + dataGridsorder.Rows[i].Cells[3].Value + "','" + dataGridsorder.Rows[i].Cells[4].Value + "','" + dataGridsorder.Rows[i].Cells[5].Value + "','" + dataGridsorder.Rows[i].Cells[6].Value + "','" + dataGridsorder.Rows[i].Cells[7].Value + "')",conn);
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
MessageBox.Show("Your order is successfully completed...", "Information Messsage", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
像这个 MessageBox 一样,我想显示鼠标是否没有移动。
【问题讨论】:
-
这是手动方式,但我希望它在输入处于活动状态时自动显示消息。提前谢谢你。
标签: c#