Spinner control to show 8M instead of 8,000,000

Editors for WPF Forum

Posted 9 years ago by PhilipK - QuIC Financial Technologies Inc
Avatar
What's the best way to go if I want a spinner control to display 8M instead of 8,000,000 or
3,000,000,000 as 3B. However, the control should keep the actual value in double.

Thanks.

Comments (3)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Philip,

The Spinner control doesn't display a value, it's just two buttons for incrementing and decrementing. It's used in several parts-based editors, such as Int32EditBox and DoubleEditBox. If you are referring to those controls, then what you describe is not currently supported. We've marked down a TODO item to see about adding this feature in the future.


Actipro Software Support

Posted 9 years ago by PhilipK - QuIC Financial Technologies Inc
Avatar
Yes, I am talking about ie. PartEditBox, RangeTypeSpecificEditBoxBase, DoubleEditBox, etc. So is there a way to maybe inherit from RangeTypeSpecificEditBoxBase or other control to make it behave like that? What I am looking for is to have the textbox part to display something else instead of the actual value.

Thanks.
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Philip,

You might be able to accomplish that by restyling the DoubleEditBox. Basically, you want to overlay a TextBlock on top of the SlottedItemsPresenter in the ControlTemplate. When the DoubleEditBox does not have focus, you'd display your TextBlock. When it does have focus you'd display the SlottedItemsPresenter.

This wouldn't allow you to enter/modify the value "8M", but would display it when the control is not in use. Modifying the control to accept "8M" would be larger change and I don't believe that can be accomplished with the current version.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.