Focusing the text box at the rightmost digit

how to do it in vb.net:

focus the text box and hover over the rightmost digit?

0


a source to share


1 answer


In WindowsForm, you can use:

Me.TextBox1.Focus()
Me.TextBox1.SelectionStart = TextBox1.Text.Length

      



In WebForm you can set focus using javascript function like:

function setCursorPosition(elemId, cursorPosition) {
    var element = document.getElementById(elemId);
    if(element != null) {
        if(element.selectionStart) {
            element.focus();
            element.setSelectionRange(cursorPosition, cursorPosition);
        }
        else
            element.focus();
    }
} 

      

+2


a source







All Articles