如何从MassegeBox复制文本 [英] How to Copy Text from MassegeBox

查看:57
本文介绍了如何从MassegeBox复制文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在使用点网Windows应用程序,我想授予用户从消息框中选择任何文本并进行复制的权限.

CTRL + C和CTRL + V复制完整消息.

用户从消息框中选择任何内容并复制.

请帮忙

感谢

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

推荐答案

http://vkreynin.wordpress.com/2007/10/02/copy-text-from-a-messagebox/ [
http://vkreynin.wordpress.com/2007/10/02/copy-text-from-a-messagebox/[^] could help you.


您可以使用对话框形式而不是使用消息框.
将ContextMenuStrip项目添加到对话框,然后向其添加click方法.
将副本设置为clipborad到要发送到剪贴板的文本或标签.如下所示.


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.


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


这篇关于如何从MassegeBox复制文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆