NumericUpDown ValueChanged事件会立即产生影响吗?(NumericUpDown ValueChanged event with immediate consequences?)
我正在用C#(.NET 4.0)编写一个小应用程序。 我想在numericUpDown中值更改时触发事件,但似乎当控件失去焦点或有多个更改时,numericUpDown ValueChanged将触发。
详细说明:我使用对象的属性绑定(OnPropertyChanged)numericUpDown,以便立即反映更改。 但我还需要使用这个新更改的numericUpDown值来计算某些内容(全局/与对象无关)。 但是如果我使用ValueChanged事件,那就太晚了。
简短的介绍:
我需要一个与OnPropertyChanged具有类似功能的事件。
我能做什么?
编辑:在ValueChanged事件处理程序中,我对对象进行了一些计算,但是已更改的值尚未提交给object属性,因此我认为ValueChanged事件滞后。
感谢您的帮助。
I'm writing a small application in C# (.NET 4.0). I want to fire an event when value changes in numericUpDown, but it seems that numericUpDown ValueChanged fires when control loses focus or when there are multiple changes.
Long description: I am binding (OnPropertyChanged) numericUpDown with a property of an object, so that the changes are reflected immediately. But I also need to calculate something (global / not related to object) using this newly changed value of numericUpDown. But if I use ValueChanged event, it fires too late.
Short description:
I need an event with similar functionality to OnPropertyChanged.
What can I do?
EDIT: In ValueChanged event handler I did some calculations on the objects, but the value that has changed wasn't yet committed to the object property, thus I thought that the ValueChanged event was lagging behind.
Thank you for your help.
原文:https://stackoverflow.com/questions/11168922
满意答案
如果我正确理解你的问题,那么这样的事情可能有效:
for %%i in ( "D:\Folder4\subfolder1\*.bat" "D:\Folder4\subfolder2\*.bat" "D:\Folder4\subfolder3\*.bat" "D:\Folder4\subfolder4\*.bat" "D:\Folder4\subfolder5\*.bat" "D:\Folder4\subfolder6\*.bat" ) do XCOPY /U /Y "C:\folder1\*.bat" "%%i"
基本上
XCOPY
命令有我认为你需要的选项。编辑
我的理解在增长:P ......这可能更符合您的要求:
@echo off for /r D:\Folder4\ %%i in (*.bat) do ( for /r C:\folder\ %%j in (*.bat) do ( if %%~ni == %%~nj XCOPY /U /Y "%%j" "%%i" ) ) pause
If I'm understanding your question correctly, then something like this may work:
for %%i in ( "D:\Folder4\subfolder1\*.bat" "D:\Folder4\subfolder2\*.bat" "D:\Folder4\subfolder3\*.bat" "D:\Folder4\subfolder4\*.bat" "D:\Folder4\subfolder5\*.bat" "D:\Folder4\subfolder6\*.bat" ) do XCOPY /U /Y "C:\folder1\*.bat" "%%i"
Basically the
XCOPY
command has the options I believe you require.EDIT
My understanding grows :P ...this perhaps is more what you seek:
@echo off for /r D:\Folder4\ %%i in (*.bat) do ( for /r C:\folder\ %%j in (*.bat) do ( if %%~ni == %%~nj XCOPY /U /Y "%%j" "%%i" ) ) pause
相关问答
更多用于查找和替换多个子文件夹中的文件的Bat脚本 - 将.java文件替换为特定文件夹中的.class文件(Bat script to find and replace files in multiple subfolders - replace .java files with .class files from specific folder)
如何重命名多个子文件夹中多个文件的扩展名(.jpg)?(How to rename the extension (.jpg) of multiple files in multiple subfolders?)
如何将特定文件从多个子文件夹移动到各自的父文件夹?(How can I move specific files from multiple subfolders to their respective parent folder? (Windows batch))
Bash:将多个文件移动到子文件夹中(Bash: Moving multiple files into subfolders)
批量替换多个子文件夹中的多个文件(Batch replace multiple files in multiple subfolders)
使用循环来rar主文件夹中的多个子文件夹(Using a loop to rar multiple subfolders in a main folder)
如何在整个master文件夹中扫描多个子文件夹?(How do i scan multiple subfolders within an overall masterfolder? [duplicate])
使用Windows批处理脚本在文件夹中的多个文件中查找和替换字符串(Find and replace string in multiple files within a folder using windows Batch script)
重命名多个子文件夹中的项目(Rename-item in multiple subfolders)
SSIS从多个子文件夹中获取文件(SSIS Get files from multiple subfolders)
相关文章
更多storm事件管理器EventManager源码分析-event.clj
Solr参数(DisMax Event Facet)
JavaScript 事件
JavaScript 事件
解析JavaScript的事件机制
HTML5服务器事件发送(Server-Sent Events)【HTML5教程 - 第十三篇】
触摸事件和微信实现原理
页面事件问题
基于YMP-WeChat模块接收并处理微信事件及消息的代码
java 监听redis过期key事件实现延迟队列功能
最新问答
更多获取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),本站将尽快处理。谢谢合作!