Part Transitions & Caret Size

Editors for WPF Forum

Posted 12 years ago by Mike Strobel - New York, NY
Great job with the editors, guys--having had more time to explore them, they really are quite slick.

First, a quick observation: the caret displayed in an editor part appears to have a width of 2px while the standard WPF caret (displayed between parts) has a width of 1px. I just think it looks a little inconsistent. I'd suggest either changing it to 1px or adding a property to CaretLayer to set the width.

Second, I noticed that when I enter a complete value for an editor part (e.g. a "MM" month field in the DateTimeEditBox), typing another character does not send me to the next part. For example, given a DateTimeEditBox:


...where ^ represents the position of the caret, typing another number does not transfer focus to the day field. I have to manually hit '/', tab, etc. I think in cases where the current part's data is complete, focus should transfer automatically (assuming valid input), so I could simply type the sequence "01241984" to fill out "01/24/1984". If there are potential issues with this behavior that I'm overlooking, a property to toggle the behavior on/off would be fine.


[Modified at 03/29/2009 01:30 PM]

Comments (5)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Mike,

We followed the native WPF TextBox, which uses 2-pixels (on Vista Aero anyway). I see that the non-WPF TextBoxes use 1-pixel, so I added an attached property that will allow you to change the width of the caret though.

I added your second item to the TODO list. Right now the underlying MaskedTextBox only has an IsMatched property and associated event, but this also fires when say "1" is entered. Since "1" is valid, as is "01" and "12". So really this would only transition when the mask is completed *and* no more characters can be entered.

Actipro Software Support

Posted 12 years ago by Mike Strobel - Software Engineer, CDC Software
Thanks! Seems you're right about the caret size in the standard WPF textbox. I was actually more concerned with the inconsistency within the same editor control.
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Ah, I see. Looks like the MaskTextBox is clipping the caret, which it probably should not do when used inside a part. I've made a note to fix this next. Thanks :)

Actipro Software Support

Posted 11 years ago by Robert A. McCarter
I second Mike's request for simply being able to type in a series of numbers and having the control automatically skip over the date separators.

Thanks - this control is SO much nicer (and faster, and less buggy) than Infragistic's version!
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Robert,

Thanks for the compliments :-) We've already implemented this feature for the next maintenance release. Look for the "PartEditBox Moving Focus QuickStart" to see it in action.

Actipro Software Support

The latest build of this product (v2020.1.0) was released 23 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.