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. Force TextBox to show cursor

Force TextBox to show cursor

Scheduled Pinned Locked Moved C#
question
7 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.
  • C Offline
    C Offline
    Christian Wikander
    wrote on last edited by
    #1

    Is it possible to force a TextBox to show it's input cursor even though it's not active?

    Z C 2 Replies Last reply
    0
    • C Christian Wikander

      Is it possible to force a TextBox to show it's input cursor even though it's not active?

      Z Offline
      Z Offline
      Zoltan Balazs
      wrote on last edited by
      #2

      I don't think it's a good idea, because that would be confusing! Why would you do anything like that? And no I don't think it possible.

      Work @ Network integrated solutions | Flickr | A practical use of the MVC pattern

      C 1 Reply Last reply
      0
      • Z Zoltan Balazs

        I don't think it's a good idea, because that would be confusing! Why would you do anything like that? And no I don't think it possible.

        Work @ Network integrated solutions | Flickr | A practical use of the MVC pattern

        C Offline
        C Offline
        Christian Wikander
        wrote on last edited by
        #3

        I want it because we're writing a custom autocomplete function. We show a popup list, but when the popup is shown it's not possible to see what part of the textbox is being edited.

        S 1 Reply Last reply
        0
        • C Christian Wikander

          Is it possible to force a TextBox to show it's input cursor even though it's not active?

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          No. And yes, that does suck, and it would confuse your users if you could do it.

          Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          C 1 Reply Last reply
          0
          • C Christian Graus

            No. And yes, that does suck, and it would confuse your users if you could do it.

            Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            C Offline
            C Offline
            Christian Wikander
            wrote on last edited by
            #5

            Well... If you read about my reason above, do you still think it will confuse my users? I think it will confuse my users not to have it.

            C 1 Reply Last reply
            0
            • C Christian Wikander

              Well... If you read about my reason above, do you still think it will confuse my users? I think it will confuse my users not to have it.

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              You can change what the selection is in the textbox, that makes more sense to me. But, the only way to get a cursor AFAIK is to focus on the textbox.

              Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

              1 Reply Last reply
              0
              • C Christian Wikander

                I want it because we're writing a custom autocomplete function. We show a popup list, but when the popup is shown it's not possible to see what part of the textbox is being edited.

                S Offline
                S Offline
                Simon P Stevens
                wrote on last edited by
                #7

                After showing the popup list, return focus to the text box to allow the cursor to be displayed. Handle keypresses on the text box and when appropriate respond to them by navigating through the list. Or Implement your own custom text box class, inherited from the TextBox and handle the drawing of the cursor yourself. The first option is defiantly the easier.

                Simon

                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