Domanda

How to set the cursor position of a MaskedTextBox in VB.NET start from right? MaskedTextBox in my form is 5 digit numeric format.

È stato utile?

Soluzione

If I understand your question.

    MaskedTextBox1.Focus()
    MaskedTextBox1.SelectionStart = 5

Altri suggerimenti

Only this helped me:

private void TxtSeriesTxtNumber_EnterLeave(object sender, EventArgs e) {
            MaskedTextBox txt = sender as MaskedTextBox;
            if (txt.IsNull()) {
                return;
            }
            txt.Select(0, 0);
        }
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top