我如何使用手动创建的按钮的click事件 [英] how can i use the click event of manually created button

查看:67
本文介绍了我如何使用手动创建的按钮的click事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
这是c#.net(framework3.5)中的Windows应用程序
我已经手动创建了按钮和文本框,而且我想在运行程序时将键入的数据保存在文本框中,并且我还想增加该按钮的click事件,以便pl z给我一个主意
谢谢q

hi to all
this is windows application in c#.net(framework3.5)
i had created the button and the text box manually and more over i want to save that typed data in text-box while running the program , and also i want rise the click event of that button so that pl z give me a idea
thank q

推荐答案

让我们假设您已经在代码中创建了button1,那么您可以使用
button1.Click +=按两次Tab键可为button1生成单击事件处理程序.
然后,您可以在其中编写自己的代码.
Let us assume you have created a button1 in your code then you can use
button1.Click += Press tab key twice to generate the click event handler for button1.
Then you can write your own code in this.


您需要一本书作为开始!现在,看看这些链接:
Button.Click事件 [ C#事件 [
You need a book to start with! For now, have a look at these links:
Button.Click Event[^]
C# Events[^]


button1.Click + = new EventHandler(button1_Click);

private void button1_Click(对象发送者,EventArgs e)
{
//功能

}
button1.Click+=new EventHandler(button1_Click);

private void button1_Click(object sender, EventArgs e)
{
//functionality

}


这篇关于我如何使用手动创建的按钮的click事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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