Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Setting a control focus when form is loaded

Setting a control focus when form is loaded

Scheduled Pinned Locked Moved C#
question
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    I would like to set the focus of a text box with the blinking cursor after the form is loaded. Where in the construction do I accomplish this functionality?

    R K M 3 Replies Last reply
    0
    • A Anonymous

      I would like to set the focus of a text box with the blinking cursor after the form is loaded. Where in the construction do I accomplish this functionality?

      R Offline
      R Offline
      rudy net
      wrote on last edited by
      #2

      In FormLoad event. Ex: textbox1.Focus();

      A 1 Reply Last reply
      0
      • A Anonymous

        I would like to set the focus of a text box with the blinking cursor after the form is loaded. Where in the construction do I accomplish this functionality?

        K Offline
        K Offline
        Kodanda Pani
        wrote on last edited by
        #3

        Hi, You can use the tabindex property. Set the tabindex property of that control to 0. Thanks and Regards SGS

        1 Reply Last reply
        0
        • A Anonymous

          I would like to set the focus of a text box with the blinking cursor after the form is loaded. Where in the construction do I accomplish this functionality?

          M Offline
          M Offline
          M Waseem Chishti
          wrote on last edited by
          #4

          select the text box you want to get focus, in designer go to its properties, set "TabIndex" property to 0 and Its done :)

          1 Reply Last reply
          0
          • R rudy net

            In FormLoad event. Ex: textbox1.Focus();

            A Offline
            A Offline
            Anonymous
            wrote on last edited by
            #5

            Thank you for your help.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups