如何自动点击按钮上的表单应用程序? [英] How to Automatically Click a button On a form application?

查看:129
本文介绍了如何自动点击按钮上的表单应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有上有一个按钮,一个工作窗体应用程序。我源$ C ​​$ C了。所以,现在我想运行计划任务在Windows应用程序,我想为code修改到点击按钮动作在应用程序运行时。问题的形式应该被加载,然后再点击动作应该被解雇。我需要一个计时器这样做呢?如果是的话请你给我跟这个有帮助吗?因此,它需要大约3-4秒加载窗体应用程序。所以应该在5秒后触发点击动作

I have a working form application that has a button on it. I have the source code too. So now I am trying to run the application from schedule tasks on windows and I would like to change the code the to the click button action when the application runs. The problem is the form should be loaded first and then the click action should be fired. Do I need a timer to this? if so could you please give me a help with this? So it takes about 3-4 seconds to load the form application. so it should fire the click action after 5 seconds

推荐答案

Form.Shown 事件将触发,您可以输入您的事件到这个

The Form.Shown event will fire when the form is shown to the user for the first time, you can enter your event into this

 protected override void OnShown(EventArgs e)
 {
    base.OnShown(e);
    this.BtnClick(null, null);
 }

这篇关于如何自动点击按钮上的表单应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆