3 Replies - 6849 Views - Last Post: 23 August 2012 - 10:49 AM Rate Topic: -----

#1 ts859  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 10
  • Joined: 18-May 12

how to highlight/select text in a wpf textbox without focus?

Posted 23 August 2012 - 09:00 AM

I want to highlight selected text in a wpf textbox while the textbox is not focused. In my application, my textbox never gets focus, and every key input is done manually.

I was wondering if there is a way to highlight the selected text when the textbox is not focused?

Any help would be appreciated!
Is This A Good Question/Topic? 0
  • +

Replies To: how to highlight/select text in a wpf textbox without focus?

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5507
  • View blog
  • Posts: 11,808
  • Joined: 02-June 10

Re: how to highlight/select text in a wpf textbox without focus?

Posted 23 August 2012 - 09:07 AM

Did you even try to look this up, or experiment or use Intellesense to see the properties and methods?

The MSDN page for this control clearly shows properties for:

Attached Image

Just a tip: Software development is an industry that requires the willingness to research and experiment for your entire life. There is always new stuff to learn, new libraries, new controls, hardware API's and so on. You can't rely on asking the guy in the cubical next to you to do your research and reading for you. If you just can't be bothered with reading the documentation this isn't a good career choice for you.
Was This Post Helpful? 0
  • +
  • -

#3 ts859  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 10
  • Joined: 18-May 12

Re: how to highlight/select text in a wpf textbox without focus?

Posted 23 August 2012 - 10:06 AM

You probably didnt read the question well. It clearly says: how to highlight/select text in a wpf textbox WITHOUT FOCUS. All these properties are very common, and can only be seen by the naked eye in action IF AND ONLY IF the textbox has FOCUS. MY textbox NEVER has focus. I enter the text manually. And consequently I want to highlight a portion of the text in the textbox when my never never got focus and will neevr have focus. I have probably repeated the question for you even more clearly!
Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5507
  • View blog
  • Posts: 11,808
  • Joined: 02-June 10

Re: how to highlight/select text in a wpf textbox without focus?

Posted 23 August 2012 - 10:49 AM

Since Microsoft already told you this couldn't be done, why did you post it here?
http://social.msdn.m...60-66f025e28fee

I gave you the best solution I could within the parameters of what can be done, and what you've already been told can be done.

If you don't like that reality then do what Microsoft told you, develop your own Textbox and restyle it.

<unsubscribing>
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1