0

Ok so I am trying to do something extremely simple but its turning out to be extremely complicated. I wanted to be able to select my text for all of my labels. Since you can't do that I had to convert them all to textbox's. Now that I have that done I want the user to be able to drag their mouse across an area on the form and select whatever text they roll over. A good example would be a web browser.

EDIT

Ok I need to make this a little more clear and what better than some imagery.

enter image description here

Look at the picture above. I cannot drag my mouse across the form to select the text. I have to click inside the TextBox and then I can only select the data that is inside that specific field. I just want to be able to click and drag my mouse over whatever textbox is in my area of selection.

Steven Combs
  • 1,890
  • 6
  • 29
  • 54
  • I am not clear with " I want the user to be able to drag their mouse across an area on the form and select whatever text they roll over" – HatSoft Jul 12 '12 at 15:11
  • @HatSoft How are you not clear with that? Take your mouse and drag it across an area in your web browser. It selects text.....thats what I want to implement. – Steven Combs Jul 12 '12 at 15:12
  • this is basic windows functionality. should already be possible – ldgorman Jul 12 '12 at 15:15
  • `Duplicate of this` - http://stackoverflow.com/a/7748496/763026 – Angshuman Agarwal Jul 12 '12 at 15:26
  • @AngshumanAgarwal NO its not a duplicate. This is asking to select all text of every textbox in a form when a user drags their mouse over it. I am not asking for a single textbox selection. – Steven Combs Jul 12 '12 at 15:28
  • @meanbunny sorry wasnt being mean, so you want to select text on any control of a win form – HatSoft Jul 12 '12 at 15:33
  • do want this to happen just for textbox or anny control – HatSoft Jul 12 '12 at 15:34
  • @HatSoft in a nutshell yes. Right now just for a textbox. – Steven Combs Jul 12 '12 at 15:35
  • 1
    possible duplicate of [How to select multiple controls by mouse-dragging over them](http://stackoverflow.com/questions/10308906/how-to-select-multiple-controls-by-mouse-dragging-over-them) - as noted by the answer of @meanbunny – Balder Jan 13 '15 at 11:45

1 Answers1

0

have you "set its BorderStyle to none and set the background color to the color of your form. Also don't forget to set the readonly property to false"

from http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/5ac4267d-2642-4d05-ae84-1562bf16d068/

ldgorman
  • 1,553
  • 1
  • 14
  • 39
  • Yes I did all of that. However, when I drag the mouse across the form it selects nothing. I have to manually click in the TextBox and drag my mouse across it to get the text. I have multiple textbox's that I am trying to interact with here not just 1. – Steven Combs Jul 12 '12 at 15:19
  • each control (textbox in your case) requires that you give it focus before you can interact with it – ldgorman Jul 12 '12 at 15:22
  • it IS possible to set the focus on some user triggered event aside from mouse click perhaps onhover – ldgorman Jul 12 '12 at 15:24
  • take a look at [this](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.mousehover.aspx). using this event you can select the control without the user having to click anything – ldgorman Jul 12 '12 at 15:29