自动点击事件C#windows应用程序 [英] Auto click event C# windows application
问题描述
大家好,
我有一个应用程序,在C#windows应用程序的帮助下称为自动点击事件。
我的怀疑是:
我有一个按钮,当我点击它时,它显示一个消息框,如hi,这是提到的通过以下代码。
我想要做的是我需要在表单的按钮上单击一次,然后将显示消息框,如果没有我点击按钮,我需要经常来这个消息框?
如果有人知道这个解决方案,请告诉我。
我的代码是:
Hi all,
I have one application which is called as auto click event by the help of C# windows application.
My doubts are:
I have a button and when I click it, it is showing a message box like "hi" which is mentioned by the below code.
What I want to do is I need to click one time on the button of my form and then message box will display which is mentioned by the above point and this message box will I need to come frequently without I click button?
Please let me know if any one knows about this solution.
my code is:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
route();
}
public void route()
{
MessageBox.Show("hi");
}
}
}
提前谢谢..
Thank you in advance..
推荐答案
我认为你要问的是多次显示一个消息框而不点击每个显示的按钮。一种可能的解决方案是使用在单击按钮时启动的计时器,然后在计时器结束时显示消息框。
参见 http://msdn.microsoft.com/en-us/library/system.timers.timer%28v=vs .71%29.aspx [ ^ ]
我会提醒你,但我认为这不是一个好主意(自动显示消息框,因为当用户不得不不断地关闭消息框时,它会使用户感到愤怒。
I think what you are asking is to show a message box multiple times without clicking a button for each showing. A possible solution would be to use a timer that is started when you click the button then when the timer elapses, show the message box.
See http://msdn.microsoft.com/en-us/library/system.timers.timer%28v=vs.71%29.aspx[^]
I would caution you though, I do not think that this is really a good idea (showing message boxes automatically) as it tends to anger users when they have to dismiss message boxes continually.
这篇关于自动点击事件C#windows应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!