A Label control that its text can be selected with the mouse

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is there a way to allow the Label control to select its text with the mouse
by the user?
I've looked at the Label's properties but I couldn't find anything making
this possible.
Am I missing something here? Well, it can be done with a Textbox control,
but the problem with this approach is that when I click on a read only
Textbox, a vertical line is displayed inside it.
In short, I want something similar to internet browsers, where users can
select the text and copy it to the clipboard.

Thanks for your time,

Ben
 
HideCaret fails, and when i call Marshal.GetLastWin32Error, it
returns a value of 5, which i think means access denied.
How can i make this work please?

Thanks,
Ben
 
HideCaret fails, and when i call Marshal.GetLastWin32Error, it
returns a value of 5, which i think means access denied.
How can i make this work please?

The declaration at pinvoke.net didn't have SetLastError=true in the
DllImport attribute. Did you add that? If not, you can't expect
GetLastWin32Error to return the right error code.


Mattias
 
Hi Mattias,

Yes, I did add "SetLastError=true" to the attribute.
I have no idea why I get access denied when I call HideCaret.

Thanks,
Ben
 
Back
Top