How to Get Edit Box Focus?

104 9
    • 1). Consult documentation used in your programming framework and find the method or function that allows you to manipulate focus.

    • 2). Open the code page that contains the edit box.

    • 3). Locate the portion of the code, called a "function," that triggers the appearance of the edit box, if the edit box is not permanently embedded into the interface. It may look like this:

      UserInterfacePage.GenerateControl("Sample Control Text");

    • 4). Write the method that adds focus to the control in the line following the function call, or as soon as practical, like so:

      sampleWindow TextBox.ForceFocus();

    • 5). Save your work and test it to ensure that a user who opens your program can immediately begin to type in the edit box. Open the program and begin to type without using the mouse to click on the box. Check to ensure that the text you typed appears in the edit box.

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.