事件处理程序 [英] event handlers

查看:89
本文介绍了事件处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为在运行时创建的按钮编写单击事件

how to write a click event for a button which was created at run time

推荐答案

如果您知道如何编写事件处理程序,则:
每次创建按钮数据类型时,都可以访问属性;

例如看一下;您可以用load形式编写:

if you know how to write an event handler:
each time you create a button datatype you can access the properties ;

for example take a look at this ;you can write this in form load:

Button b1 = new Button();
            b1.Click+=new EventHandler(b1_Click)//as you type += press tab twice so it creates what you want automatically!!  



甜蜜的哈..? :-D:thumbsup:



sweet hah..? :-D :thumbsup:


这篇关于事件处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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