关于事件处理程序 [英] regarding Event handler

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

问题描述

我需要在属性窗口中将SelectIndexchanged设置为相应的值.我的意思是SelectIndexchanged旁边有一个下拉菜单,它仅显示页面加载,为什么它不显示控件名称?因此,当控件中发生事件时,将调用此方法.

Hi i need to set SelectIndexchanged to the corresponding value in the property window. I mean there is a drodown right beside the SelectIndexchanged and it only shows the page load why its not showing the control name? so that when an event occur in the control this method will get called.

推荐答案

在属性窗格中删除对页面加载事件处理程序的引用(仅适用于SelectedIndexChanged事件),然后从窗格中单击方式".再次检查时,处理程序应为空白.
现在,双击处理程序名称旁边的空白位,并应添加适当的处理程序.

发生的事情是,当您创建处理程序时,使用了下拉菜单,其中列出了当前现有的处理程序,以防万一您想将同一处理程序用于多个事件.如果您不使用下拉菜单,则会创建一个新的处理程序.
Delete the reference to the page load event handler in the properties pane (only for the SelectedIndexChanged event) and click way from the pane. When you check again, the handler should be blank.
Now, double click the blank bit beside the handler name, and an appropriate handler should be added.

What happened was when you went to create the handler, you used the drop down, which lists the current existing handlers in case you want to use the same handler for several events. If you don''t use the droip down, a new handler is created.


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

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