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
 
What about using a TextBox control with the Enabled property set to false?
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top