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. .NET (Core and Framework)
  4. How do I suppress the SelectAll when tabbing into a ComboBox?

How do I suppress the SelectAll when tabbing into a ComboBox?

Scheduled Pinned Locked Moved .NET (Core and Framework)
question
4 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.
  • P Offline
    P Offline
    Poolee
    wrote on last edited by
    #1

    Hi there I would like to be able to stop all text in a ComboBox from being automatically selected when I tab into a it (it has DropDownStyle of DropDown). Currently, I check for KeyUp event, and select the text I want to select, rather than the whole lot. This still has the effect of all text being selected temporarily until the tab key is released. Is there any way to suppress the SelectAll behaviour? Thanks in advance Paul

    One day I want to be a code monkey. Right now, I'm more like a code amoeba...

    W 1 Reply Last reply
    0
    • P Poolee

      Hi there I would like to be able to stop all text in a ComboBox from being automatically selected when I tab into a it (it has DropDownStyle of DropDown). Currently, I check for KeyUp event, and select the text I want to select, rather than the whole lot. This still has the effect of all text being selected temporarily until the tab key is released. Is there any way to suppress the SelectAll behaviour? Thanks in advance Paul

      One day I want to be a code monkey. Right now, I'm more like a code amoeba...

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      Instead of using KeyUp, try wiring Enter or GotFocus event and deselecting the text.

      The need to optimize rises from a bad design. My articles[^]

      P 1 Reply Last reply
      0
      • W Wendelius

        Instead of using KeyUp, try wiring Enter or GotFocus event and deselecting the text.

        The need to optimize rises from a bad design. My articles[^]

        P Offline
        P Offline
        Poolee
        wrote on last edited by
        #3

        Thanks Mika, GotFocus solved it. Enter occurs before the SelectAll, otherwise I would have used that. Never knew about GotFocus though, so awesome result! :) Cheers Paul

        One day I want to be a code monkey. Right now, I'm more like a code amoeba...

        W 1 Reply Last reply
        0
        • P Poolee

          Thanks Mika, GotFocus solved it. Enter occurs before the SelectAll, otherwise I would have used that. Never knew about GotFocus though, so awesome result! :) Cheers Paul

          One day I want to be a code monkey. Right now, I'm more like a code amoeba...

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          You're welcome :)

          The need to optimize rises from a bad design. My articles[^]

          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