Labview如何快速入门
满意答案
您重写了该方法,但是您没有在处理程序中调用
base.OnLeave(e)
,因此永远不会触发事件。文档非常清楚:
对继承者的说明:
在派生类中重写OnLeave时,请务必调用基类的OnLeave方法,以便已注册的委托接收事件。所以你需要覆盖这样的方法
protected override void OnLeave(EventArgs e) { base.OnLeave(e); Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Text.ToLower()); }
这将导致重写的
OnLeave
方法和连接到Leave
任何可能事件被调用。You are overriding the method, but you are not calling
base.OnLeave(e)
in your handler so the events are never triggered.The documentation is quite clear about this:
Notes to Inheritors:
When overriding OnLeave in a derived class, be sure to call the base class's OnLeave method so that registered delegates receive the event.So you need to override the method like this
protected override void OnLeave(EventArgs e) { base.OnLeave(e); Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Text.ToLower()); }
This will cause both your overridden
OnLeave
method and any possible events connected toLeave
get called.
相关问答
更多自定义指令在ng-if中第二次没有正确绑定(Custom directive not binding correctly in ng-if second time around)
可以在第二次覆盖自定义控制调用的onleave吗?(it is possiable to override onleave of custom contol call to second time?)
从自定义DatePicker DialogPreference调用自定义Time DialogPreference(call custom Time DialogPreference from custom DatePicker DialogPreference)
如何控制DateTimePicker中的时间间隔(How to contol the time interval in a DateTimePicker)
我应该在我的自定义代码之前或在我覆盖方法之后调用super.xxxx()吗?(should I call super.xxxx() before my custom code or after when I override a method?)
AngularJS自定义过滤器调用两次并在第二次调用时删除输入数据(AngularJS custom filter called twice and delete input data on second call)
单元测试react-router onEnter / onLeave(Unit Test react-router onEnter/onLeave)
第二次加载时自定义UIImagePickerController问题(Customized UIImagePickerController issue when loaded a second time)
第二次调用后自定义UIView更改(Custom UIView changes after second call)
将最大最大值添加到自定义控制范围栏[关闭](Adding min max to custom contol range bar [closed])
相关文章
更多Sentinel快速入门
Hadoop之HBase快速入门
javascript快速入门
XStream快速入门示例
Sonar快速入门
httpClient快速入门
dubbo快速入门
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!