Select Text of Label

  • Thread starter Thread starter jerry
  • Start date Start date
J

jerry

How can I allow my WinForm user to select/copy/paste the content of a
Label?
Thank you in advance, Jerry Nixon
 
Hi,

I think this is a very relevant question because most of the dialog
boxes in Windows have this facility. To elaborate, when you hover your
mouse over most labels, the cursor changes to an I-beam, and you can
select and copy the text. And they do seem to be *normal* labels.

Isn't there an *easy* way to do this in VS 2003 ?

P.S.: (Easy <> using Interoperability)

Regards,

Cerebrus.
 
Sorry. I made a mistake. I should have said to set the ReadOnly property to
true on the TextBox. Do not modify the Enabled property. If you set the
ReadOnly property to true, and set the BorderStyle to None, then this
describes the scenario that you outlined - what appears to be a Label with
an IBeam, select and copy text, etc.
 
I must confess that's a really easy way to do it. I'm kinda embarassed
to say that such a simple thing did not occur to me.

I was thinking in terms of deriving a custom label and manually
implementing all that functionality !

Thanks a lot, Tim.

Regards,

Cerebrus.
 
Back
Top