Take the 2-minute tour ×

I am currently attempting to write a Script Writer along the lines of FinalDraft and Adobe Story. I am using WPF and .NET 4.0.

Instead of using a giant textbox in which I handle the user's inputs to determine the next course of action, I decided to try using multiple textboxes which are dynamically created and positioned on top of a canvas depending on the users action.

The problem I am running across is that I'm unable to select text from different textboxes by simply dragging and holding the left mouse button. I realize that this feature is not built-in, and so I tried to use variouse mouse events to achieve this functionality with code.

Unfortunately, the events that I would need are not fired if a particular textbox has the mouse's focus.

How would you approach this problem ? Is text selection across TextBoxes even possible in WPF ?

If not, what alternative would I have other than use a single textbox ?

share|improve this question
I think this can be done, but it is not standard behavior so it may require quite a lot of code. I've not written so much in WPF. In classic winforms I think you'd probably have catch the mouse events on the container (that may be the form where the textboxes are located) instead of on the textbox. Then you'd select items in the textboxes underneath depending on the position of the mouse pointer and consume the event so it is not bubbled to the textboxes. –  mortb Jul 10 '12 at 13:17
Did you complete your task? I am looking for the same functionality. It would be great if you could share some code. Best regards. –  Gope May 22 at 7:02

1 Answer 1

up vote 1 down vote accepted

Did you try overriding the event-bubbling by attaching to mouse events using AddHandler while specifying handledEventsToo to true?

share|improve this answer
Thanks, I'll give it a try ! –  Hussein Khalil Jul 10 '12 at 13:27

Your Answer


