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

Re: Select Text of Label by Tim

Tim
Fri Apr 07 17:13:38 CDT 2006

What about using a TextBox control with the Enabled property set to false?

--
Tim Wilson
.NET Compact Framework MVP

<jerry@solutionsyndicate.com> wrote in message
news:1144447201.273693.200140@z34g2000cwc.googlegroups.com...
> How can I allow my WinForm user to select/copy/paste the content of a
> Label?
> Thank you in advance, Jerry Nixon
>



Re: Select Text of Label by Cerebrus

Cerebrus
Sat Apr 08 02:29:42 CDT 2006

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.


Re: Select Text of Label by Tim

Tim
Sat Apr 08 10:14:54 CDT 2006

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.

--
Tim Wilson
.NET Compact Framework MVP

"Cerebrus" <zorg007@sify.com> wrote in message
news:1144481382.546045.303790@v46g2000cwv.googlegroups.com...
> 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.
>



Re: Select Text of Label by Cerebrus

Cerebrus
Sat Apr 08 12:28:50 CDT 2006

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.