Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable length Text Box Mask #753

Closed
IbraheemOsama opened this issue Dec 30, 2016 · 6 comments
Closed

Variable length Text Box Mask #753

IbraheemOsama opened this issue Dec 30, 2016 · 6 comments

Comments

@IbraheemOsama
Copy link
Member

IbraheemOsama commented Dec 30, 2016

it was requested multiple times to have a variable length textbox mask to allow the following examples:

  1. Minutes : 01, 0 ,1, 59 (the mask should allow a single character or two)
  2. decimals : 1111.1111 or 1.1
    etc :)

the original request was #737 and #746

@ZingPow
Copy link

ZingPow commented Dec 31, 2016

For me the problem the user will run into is when they click on the maskedTextBox the cursor shows up on the right side of the mask, so they will naturally go backspace to enter into the 'mask' and enter their single digit, which if they have a multiply digit mask will not be recorded. Also trying to explain that
_1 and 1_ are different and only one works, isn't really putting the user first and I'm going to hear it from users. I realize that code wise its a bit of a bugger, but user wise, it makes sense.

I have tried this before
https://www.codeproject.com/articles/1156810/numeric-textbox-for-universal-windows-app-uwp
and it seemed to work in case it gives you some ideas.

@IbraheemOsama
Copy link
Member Author

@ZingPow it was designed for the user to click on any character on the textbox and the cursor will show at the selected character, the mask isn't by default setting the cursor to the right, you just clicking at the end of the box but I've a better solution if the textbox is empty and it got focus the cusror should start at the beginning else do same behavior. (Will create a bug for this)
Actually I'm in favor of a variable length masked textbox rather than a numeric textbox because it is more general :) but the community should decide with fits more

@IbraheemOsama
Copy link
Member Author

@deltakosh @hermitdave @skendrot @ScottIsAFool
how do you imagine this control ? I mean should it be similar to textbox mask when setting the mask what should indicate for a max length variable etc

@skendrot
Copy link
Contributor

This sounds like a problem for a RegEx attached property

@IbraheemOsama
Copy link
Member Author

IbraheemOsama commented Jan 16, 2017

I guess we can add RegEx attached property with another property called isValid and we validate on focus this property and set the IsValid attached property of the textbox so the user can validate on submit !!
What do you think ? of course this is not a mask we can say it's a regex validation not a mask

@deltakosh
Copy link
Contributor

I like the idea of having a second attached property that works with a regex instead of a mask.

@IbraheemOsama IbraheemOsama self-assigned this Jan 16, 2017
@ghost ghost locked as resolved and limited conversation to collaborators Nov 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants