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. Visual Basic
  4. Losing Focus

Losing Focus

Scheduled Pinned Locked Moved Visual Basic
tutorialquestiondiscussion
4 Posts 3 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.
  • S Offline
    S Offline
    Sled Dog
    wrote on last edited by
    #1

    Members, I am interested in maintaining my tab order on a web page. I have a very simple page with 2 dialog boxes & 2 dropdownlist boxes. Field1 DropDownList1 Field2 DropDownList2 I have the tab order set from left to right from the top down. So, you cursor move from Field1 to DropDownList1, to Field2 and finally to DropDownList2. However, when the selectedindexchanged event fires, I no longer maintain my focus and leave DropDownList1 and land in Field2. Where does the cursor go (besides the address bar of the current webpage) and how to I get the focus to move to the next field in order? Any thoughts would be appreciated. Thank you.

    D 1 Reply Last reply
    0
    • S Sled Dog

      Members, I am interested in maintaining my tab order on a web page. I have a very simple page with 2 dialog boxes & 2 dropdownlist boxes. Field1 DropDownList1 Field2 DropDownList2 I have the tab order set from left to right from the top down. So, you cursor move from Field1 to DropDownList1, to Field2 and finally to DropDownList2. However, when the selectedindexchanged event fires, I no longer maintain my focus and leave DropDownList1 and land in Field2. Where does the cursor go (besides the address bar of the current webpage) and how to I get the focus to move to the next field in order? Any thoughts would be appreciated. Thank you.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Since this is a web application, you have no control over the focus from VB.NET. You'll have to add JavaScript to your web page to control the focus. But, I have no idea how to do it. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      A 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Since this is a web application, you have no control over the focus from VB.NET. You'll have to add JavaScript to your web page to control the focus. But, I have no idea how to do it. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

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

        Dave, I do know how to set focus with javascript, in fact, I have a utility DLL compiled with my application for setting the focus on a specific control when a web page loads. However, when I put that function in as the last statement of my .SelectedIndexChanged event -- I can see the focus go there, but it does not stay because the page gets refreshed again (I suppose). William

        D 1 Reply Last reply
        0
        • A Anonymous

          Dave, I do know how to set focus with javascript, in fact, I have a utility DLL compiled with my application for setting the focus on a specific control when a web page loads. However, when I put that function in as the last statement of my .SelectedIndexChanged event -- I can see the focus go there, but it does not stay because the page gets refreshed again (I suppose). William

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Anonymous wrote: However, when I put that function in as the last statement of my .SelectedIndexChanged event -- I can see the focus go there, but it does not stay because the page gets refreshed again (I suppose). Yes it does. This is why you really can't control the focus from the server-side. The focus must be setup and controlled entirely in client-side JavaScript in your page. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          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