kkh
kkh

Reputation: 4869

Selected text lost focus in one textbox

I have two textbox A and B which have the same text. So when i select some text in A, same text in B will be selected. I can do this but the highlight will disapppear in A instead when the text in B is highlighted. How do I make it such that in both textboxes, the text will be highlighted?

Upvotes: 1

Views: 331

Answers (2)

Kimbo
Kimbo

Reputation: 1388

I think for this requierement you have to program a custom control based on the textbox control. Then you can override the action which focus and highlight the textbox. Then this custom control only highlight and dont set the focus at the second textbox.

Its only an idea i dont know how it works in practice...

Upvotes: 1

Polity
Polity

Reputation: 15130

I dont think this is an easy thing to do. By default, only 1 'thing' at the time can be highlighted. This is logical because what if we highlight and press CTRL + C. If there are 2 things highlighted (selected), we have some weird/unpredictable functionality going on.

You can however make your own custom TextBox control inherited from the defacto TextBox in which you can bind multiple textboxes together and let them reflect their highlights.

Upvotes: 1

Related Questions