Time Spinner Unfocused Color

Editors for WPF Forum

Posted 10 years ago by David Mullin
Avatar
The dropdown arrow for a DateTimeEditBox control is always black. The spinner for either of the numeric edit controls (Int or Double) are always black. The spinner for the Time portion of a DateTimeEditBox, however, is only black when focus is in the field - otherwise, it is gray (looking disabled).

Is there a setting that I'm missing to control this - so that it will always be black?

David Mullin

[Modified at 06/11/2009 11:29 AM]

Comments (3)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi David,

The spinners are normally only enabled when a spinnable part (e.g. the Month part) has focus. If the focus is not in the DateTimeEditBox, then the spinners are disabled because we don't know which value to spin.

Int32EditBox and DoubleEditBox have special hooks, because with those there is only 1 default part/value so we know how to spin it.


Actipro Software Support

Posted 10 years ago by David Mullin
Avatar
Well, if the DateTimeEditBox is configured so that only the Time portion is visible (which is the case in my situation), by that reasoning, the spinner should be enabled.

Is there any way to accomplish this?
Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi David,

The time is not a single part (like Int32 or Double), there are parts for hours, minutes, seconds, fractions of a second, and am/pm designator. So assuming none of those parts had focus, what value would you expect to be spun?

We could add a StepValue property of type TimeSpan that would only be used when a spinnable part doesn't have focus. But in this case the meaning of the spinner would change, when one of the parts got focus. So if you configured StepValue to be 1 minute and the hour part had focus then it would actually be +/- 1 hour, not 1 minute.

What are your thoughts on this?

With the existing code, you can create a derivation of DateTimeEditBox and override GetSpinnable (gets the ISpinnable that should be spun), or OnCanExecuteDecrementValue/IncrementValue and OnExecutedDecrementValue/IncrementValue. Either of these would allow you to use any custom logic you want.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 13 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.