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. textbox & tab page bugg?

textbox & tab page bugg?

Scheduled Pinned Locked Moved C#
debuggingquestion
3 Posts 2 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
    rbuchana
    wrote on last edited by
    #1

    I have a single line TextBox in one TabPage in a TabControl. The TabControl SelectedIndexChanged event handler looks like private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { if (tabControl1.SelectedIndex == 0) this.textBox1.Focus(); } When I toggle through the tab pages via Control-Tab everything looks good. When I toggle backwards through the tab pages via Control-Shift-Tab the text alignment of the text box somehow gets set to right, even though when I step through the debugger the TextAlign property is set to HorizontalAlignment.Left Any ideas?

    R 1 Reply Last reply
    0
    • R rbuchana

      I have a single line TextBox in one TabPage in a TabControl. The TabControl SelectedIndexChanged event handler looks like private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { if (tabControl1.SelectedIndex == 0) this.textBox1.Focus(); } When I toggle through the tab pages via Control-Tab everything looks good. When I toggle backwards through the tab pages via Control-Shift-Tab the text alignment of the text box somehow gets set to right, even though when I step through the debugger the TextAlign property is set to HorizontalAlignment.Left Any ideas?

      R Offline
      R Offline
      rohitsrivastava
      wrote on last edited by
      #2

      Hi Friend u can do only one thing . you have written tabcontrol1_selectedindexchanged instead you write tabcontrol1_click event . then curli braces u write this.textbox1.focus your problem is solve have a good day

      R 1 Reply Last reply
      0
      • R rohitsrivastava

        Hi Friend u can do only one thing . you have written tabcontrol1_selectedindexchanged instead you write tabcontrol1_click event . then curli braces u write this.textbox1.focus your problem is solve have a good day

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

        Yes but then the focus will not get set to the text box, if the user uses Control-Tab to scroll through the tab pages.

        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