Click here to Skip to main content
15,886,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I m using dot net Windows application and i want to give the permission to the user to select any text from message box and copy it.

CTRL+C and CTRL+V copy full message.

User select any content from message box and copy it.

Please help

thanks
Posted

 
Share this answer
 
Comments
anshumansharma 17-May-12 1:42am    
Thanks for reply
CTRL+C and CTRL+V copy full message.
we require, user can select text, which user need and copy it from message box.
Example: "your Receipt No. is 101 , Please save this receipt no for further processing"
want to copy only 101. not full message.
You can use a Dialog form instead of using a message box.
Add a ContextMenuStrip item to the Dialog then add a click method to it.
Set the copy to clipborad to the text or label you want to be sent to the clipbboard. something like below.


VB
Private Sub CopyMessageToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyMessageToolStripMenuItem.Click
    Dim message As String
    message = Label1.Text
    My.Computer.Clipboard.Clear()
    My.Computer.Clipboard.SetText(message)
End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900