


























在NumberUpdown 的Valuechange事件中加入以下代码,自动处理12月加1,年度加1,01月减1,年份减1问题
int currentMonth = (int)(nudFlowMonth1.Value) % 100; int currentYear = (int)(nudFlowMonth1.Value) / 100; if (currentMonth > 12) { currentMonth = 1; currentYear++; nudFlowMonth1.Value = currentYear * 100 + currentMonth; } if (currentMonth < 1) { currentMonth = 12; currentYear--; nudFlowMonth1.Value = currentYear * 100 + currentMonth; }
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。