Maskedtextbox

hello. A question please. how can I give the focus to a maskedtextBox

Answer this question

Maskedtextbox

  • Badri Narayanan

    Then there's probably something in your code that is stealing the focus - which control ends up being focused when you try MaskedTextBox1.Focus() And if the control is disabled, focus won't work.


  • SQLServer2050

    Thanks. I place 2 controls on a form. A textbox (tabindex=0) and a maskedtextbox (tabindex=1). In the load event of the form I only wrote maskedtext.box.focus. I don't know why it doesn't work.


  • db_guy

    Thanks, but It doesn't work.
  • Solrac Otr

    Try placing that code in the Shown event.

    Tony


  • Musafir

    Use its .Focus() method, like this: MaskedTextBox1.Focus()

  • Maskedtextbox