NumericUpDown 控件可以做到这一点吗?
我正在尝试 NumericUpDown 控件,并对它的灵活性有疑问。基本上,我想做的是显示年份范围,如下所示:
2006-2007; 2007-2008; 2008-2009; 2009-2010
显然,我希望控件在按下按钮时能够在与此类似的范围内循环。
如果可能的话,该范围需要从 2006 年至 2007 年开始,并从当年 + 1 开始(即 2009 年至 2010 年;明年:2010 年至 2011 年)。
这可能吗?有人有例子吗?我目前将其设置为组合框,但认为 NumericUpDown 控件在这种情况下使用起来会很方便。
谢谢...
I'm experimenting with the NumericUpDown control and have a question regarding its' flexibility. Basically, what I would like to do is display year ranges like so:
2006-2007;
2007-2008;
2008-2009;
2009-2010
Obviously, I would like the control to cycle through a range similar to this when the buttons are pushed.
If this is possible, the range would need to start at 2006-2007 and at the current year + 1 (i.e. 2009-2010; next year: 2010-2011).
Is this possible? Anyone have any examples? I currently have this set up as a combo box, but thought the NumericUpDown control would be nifty to use in this situation.
Thanks...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
DomainUpDown 控件可以实现您想要的功能吗?
Would a DomainUpDown control do what you want?
尝试将 NumericUpDown 放在表单上的标签旁边并调整大小,以便该值不可见(这可以在用户控件中完成),然后在 NumericUpDown 上的 ValueChanged 事件处理程序中:
Try putting a NumericUpDown next to a label on the form and resize so the value is not visible (this could be done within a user control) then in the ValueChanged event handler on the NumericUpDown: