I made my first experiments with this control. I was astounded that I had to do the following to get the cursor to be at the start of the string when the user tabbed into the control (otherwise it was at the end of it ???)
private void radMaskedEditBox1_Enter(object sender, EventArgs e)
{
radMaskedEditBox1.SelectionLength = 0;
radMaskedEditBox1.SelectionStart = 0;
}
So okay, I didn't expect this behavior, but ...
Next, I wanted to put a blank (or underscore, or whatever) into the text when the number my user entered had less digits than the full amount.
Wow! Here's one attempt:
private void radMaskedEditBox1_Leave(object sender, EventArgs e)
{
int len = radMaskedEditBox1.Text.Length;
string val = radMaskedEditBox1.Text;
while (val.EndsWith("_"))
val = "0" + val.Substring(0, val.Length - 1);
radMaskedEditBox1.Text = val;
}
Whatever leading character I tried (" ", "0", "_") the result was the same. There is simply no way that I can see to right-justify the number, although that is how most numbers are presented.
Have I missed something? Sure the cursor should automatically go to the start of the field on entry, and numbers should be right justified?
Cheers,
Helen
private void radMaskedEditBox1_Enter(object sender, EventArgs e)
{
radMaskedEditBox1.SelectionLength = 0;
radMaskedEditBox1.SelectionStart = 0;
}
So okay, I didn't expect this behavior, but ...
Next, I wanted to put a blank (or underscore, or whatever) into the text when the number my user entered had less digits than the full amount.
Wow! Here's one attempt:
private void radMaskedEditBox1_Leave(object sender, EventArgs e)
{
int len = radMaskedEditBox1.Text.Length;
string val = radMaskedEditBox1.Text;
while (val.EndsWith("_"))
val = "0" + val.Substring(0, val.Length - 1);
radMaskedEditBox1.Text = val;
}
Whatever leading character I tried (" ", "0", "_") the result was the same. There is simply no way that I can see to right-justify the number, although that is how most numbers are presented.
Have I missed something? Sure the cursor should automatically go to the start of the field on entry, and numbers should be right justified?
Cheers,
Helen