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. Strange Problem Regarding TabIndex

Strange Problem Regarding TabIndex

Scheduled Pinned Locked Moved C#
helpcsharpvisual-studiowinformslearning
9 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.
  • R Offline
    R Offline
    RizwanSharp
    wrote on last edited by
    #1

    Hello Devs, I'm facing a very strange problem in Windows Form Application using Visual Studio 2005. I have a lot of controls on my Windows Forms like TableLayoutPanels, TextBoxes, RichTextBoxes, Buttons. I set their TabIndexes appropriatley from 0,1,2,3..... When I run the application The cursor focus is not on the control whoes TabIndex Property is se to zero :mad:. I need to Focus myself on the control I want to be focued when application runs. I'm stucked with this for more than 6-7 hours, Removed all the resource file Entries of TabIndex and set all of them again. (Didnot work). Tried to Set focus on tha control in Form's Load event (Didnot work too). Also Saw the Property in Form's Load even that if that control can be focused using Control.CanFocus (Always Returns false). Please tell me something about this Bull S***:mad: Its a pain in A** for me at this time. I'll be really thankful to you for your help. Best Regards, Rizwan.

    I P 2 Replies Last reply
    0
    • R RizwanSharp

      Hello Devs, I'm facing a very strange problem in Windows Form Application using Visual Studio 2005. I have a lot of controls on my Windows Forms like TableLayoutPanels, TextBoxes, RichTextBoxes, Buttons. I set their TabIndexes appropriatley from 0,1,2,3..... When I run the application The cursor focus is not on the control whoes TabIndex Property is se to zero :mad:. I need to Focus myself on the control I want to be focued when application runs. I'm stucked with this for more than 6-7 hours, Removed all the resource file Entries of TabIndex and set all of them again. (Didnot work). Tried to Set focus on tha control in Form's Load event (Didnot work too). Also Saw the Property in Form's Load even that if that control can be focused using Control.CanFocus (Always Returns false). Please tell me something about this Bull S***:mad: Its a pain in A** for me at this time. I'll be really thankful to you for your help. Best Regards, Rizwan.

      I Offline
      I Offline
      Ingo
      wrote on last edited by
      #2

      I once had the same problem. I had to put the focus on the control I wanted with control.BringToFront(); I don't know why the TabIndex sometimes don't work with VS2005, but I didn't found the error. After I reinstalled the computer (and VS2005) it worked fine. Regards, Ingo

      ------------------------------ PROST Roleplaying Game War doesn't determine who's right. War determines who's left.

      R 2 Replies Last reply
      0
      • I Ingo

        I once had the same problem. I had to put the focus on the control I wanted with control.BringToFront(); I don't know why the TabIndex sometimes don't work with VS2005, but I didn't found the error. After I reinstalled the computer (and VS2005) it worked fine. Regards, Ingo

        ------------------------------ PROST Roleplaying Game War doesn't determine who's right. War determines who's left.

        R Offline
        R Offline
        RizwanSharp
        wrote on last edited by
        #3

        Hmm, Its impossible to reinstall all the things again. But yes you are so true this is some bug with VS 2005 coz my friends also complained me about this when i discussed my problem with him. Anyways there are 2 possibilities: 1) I Compile it at some other computer. 2) I use the method you used control.BringToFront(); Can I put control.BringToFront(); in Form's Load Event? Can you explain the code: Should I use this: control.BringToFront(); control.Focus(); in Form's Load Event? Thanks a lot for your reply, Best Regards, Rizwan

        1 Reply Last reply
        0
        • I Ingo

          I once had the same problem. I had to put the focus on the control I wanted with control.BringToFront(); I don't know why the TabIndex sometimes don't work with VS2005, but I didn't found the error. After I reinstalled the computer (and VS2005) it worked fine. Regards, Ingo

          ------------------------------ PROST Roleplaying Game War doesn't determine who's right. War determines who's left.

          R Offline
          R Offline
          RizwanSharp
          wrote on last edited by
          #4

          tried this: (Didnot work) private void FrmServer_Load(object sender, EventArgs e) { rtfSend.BringToFront(); } Nor this: private void FrmServer_Load(object sender, EventArgs e) { rtfSend.BringToFront(); rtfSend.Focus(); } Nor this One: private void FrmServer_Load(object sender, EventArgs e) { rtfSend.Focus(); rtfSend.BringToFront(); rtfSend.Focus(); } :sigh::sigh::sigh::sigh::~ Any Help?? :confused::confused::confused: Thanks a lot Best Regards, Rizwan

          I 1 Reply Last reply
          0
          • R RizwanSharp

            tried this: (Didnot work) private void FrmServer_Load(object sender, EventArgs e) { rtfSend.BringToFront(); } Nor this: private void FrmServer_Load(object sender, EventArgs e) { rtfSend.BringToFront(); rtfSend.Focus(); } Nor this One: private void FrmServer_Load(object sender, EventArgs e) { rtfSend.Focus(); rtfSend.BringToFront(); rtfSend.Focus(); } :sigh::sigh::sigh::sigh::~ Any Help?? :confused::confused::confused: Thanks a lot Best Regards, Rizwan

            I Offline
            I Offline
            Ingo
            wrote on last edited by
            #5

            That's strange, but I don't get the same error now, so I can't test it. Sorry, Ingo

            ------------------------------ PROST Roleplaying Game War doesn't determine who's right. War determines who's left.

            R 1 Reply Last reply
            0
            • R RizwanSharp

              Hello Devs, I'm facing a very strange problem in Windows Form Application using Visual Studio 2005. I have a lot of controls on my Windows Forms like TableLayoutPanels, TextBoxes, RichTextBoxes, Buttons. I set their TabIndexes appropriatley from 0,1,2,3..... When I run the application The cursor focus is not on the control whoes TabIndex Property is se to zero :mad:. I need to Focus myself on the control I want to be focued when application runs. I'm stucked with this for more than 6-7 hours, Removed all the resource file Entries of TabIndex and set all of them again. (Didnot work). Tried to Set focus on tha control in Form's Load event (Didnot work too). Also Saw the Property in Form's Load even that if that control can be focused using Control.CanFocus (Always Returns false). Please tell me something about this Bull S***:mad: Its a pain in A** for me at this time. I'll be really thankful to you for your help. Best Regards, Rizwan.

              P Offline
              P Offline
              Paul Brower
              wrote on last edited by
              #6

              It might be a good idea to look at the control that IS getting focus when you load your form. Is it a panel? I've had to set the TabStop property to false on a panel before, even though it had a high tab index.

              R 1 Reply Last reply
              0
              • P Paul Brower

                It might be a good idea to look at the control that IS getting focus when you load your form. Is it a panel? I've had to set the TabStop property to false on a panel before, even though it had a high tab index.

                R Offline
                R Offline
                RizwanSharp
                wrote on last edited by
                #7

                Yes, I have tried all the things, I set all the panels and all oher controls' TabStop property to false. But again the same proble. When I run the application, The focus of the control must be at the control whose TabIndex is 0 rather it focuses control with TabIndex 2. When I try check CanFocus property of Controls with TabIndex 0 in Form's Load it returns false. I want to know the reason what's the reason behind "Control.CanFocus is always false". How does it evaluate this that it cannot be focused. If i know this then may be we can solve the problem. Thanks alot, Best Regards, Rizwan Ahmed.

                1 Reply Last reply
                0
                • I Ingo

                  That's strange, but I don't get the same error now, so I can't test it. Sorry, Ingo

                  ------------------------------ PROST Roleplaying Game War doesn't determine who's right. War determines who's left.

                  R Offline
                  R Offline
                  RizwanSharp
                  wrote on last edited by
                  #8

                  Ahhhh! Ok, Thanks. But are you sure Windows and Visual Studio Reinstallation can fix this problem:confused::confused: I think this configuration may only reside in Resource files which i refined clearly but not working :-> Thanks a lot, Regards, Rizwan

                  I 1 Reply Last reply
                  0
                  • R RizwanSharp

                    Ahhhh! Ok, Thanks. But are you sure Windows and Visual Studio Reinstallation can fix this problem:confused::confused: I think this configuration may only reside in Resource files which i refined clearly but not working :-> Thanks a lot, Regards, Rizwan

                    I Offline
                    I Offline
                    Ingo
                    wrote on last edited by
                    #9

                    dotnetdev83 wrote:

                    But are you sure Windows and Visual Studio Reinstallation can fix this problem

                    No sorry I'm not sure. For me it worked, but I don't know if our problems have the same cause. Regards, Ingo

                    ------------------------------ PROST Roleplaying Game War doesn't determine who's right. War determines who's left.

                    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