嗨朋友.... 我需要制作一个计数器作为以下问题..... 如果偏差文本框得到负值然后延迟pm将计数增量偏差文本框获得正值然后待处理的pm将增加... 这是我如何找到偏差
private void dtpPM_ValueChanged( object sender,EventArgs e) { DateTime startdate = Convert.ToDateTime(dtpPM.Text.ToString()) ; DateTime enddate = Convert.ToDateTime(dtpPMCom.Text.ToString()); System.TimeSpan diffResult = startdate - enddate; txtdeviation.Text = diffResult.ToString(); }工作正常......我需要找到 的点数例如: - 偏差= -3 延迟pm = 1 待定pm = 0 偏差= 4 延迟pm = 0 等待pm = 1 仍然我没有找到任何解决方案....请任何人帮助我... :( 谢谢
解决方案如果你需要,请尝试以下根据时间跨度增加 如果(diffResult< 0) {延迟++; } 其他 {待定++; }
尝试 txtdeviation.Text = txtdeviation.Text - diffResult.ToString();
Hi friends.... I need to make a counter as following problem ..... if the deviation textbox get minus value then delayed pm will be count increment deviation text box gets positive value then the pending pm will be increment ... this is how I find the deviation
private void dtpPM_ValueChanged(object sender, EventArgs e) { DateTime startdate = Convert.ToDateTime(dtpPM.Text.ToString()); DateTime enddate = Convert.ToDateTime(dtpPMCom.Text.ToString()); System.TimeSpan diffResult = startdate - enddate; txtdeviation.Text = diffResult.ToString(); }it's working fine.... I need to find the count for eg :- deviation = -3 delayed pm = 1 pending pm = 0 deviation = 4 delayed pm = 0 pending pm = 1 still I didn't find any solution.... pls anyone help me... :( thanks
解决方案 try below if you need to increment base on time span if(diffResult <0) { delayed++; }else { pending++; }Try txtdeviation.Text = txtdeviation.Text - diffResult.ToString();更多推荐
为文本框制作一个计数器
发布评论