将多个项目从数据网格复制到剪贴板 [英] Copying mltiple items from a data grid to a clipboard

查看:101
本文介绍了将多个项目从数据网格复制到剪贴板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据网格视图,如果用户选择特定的行,则可以选择复制,它将把第一列数据添加到剪贴板.我需要帮助,如果用户选择多个列,它将为每个项目添加第一个colmns数据.以下是即时通讯使用的代码.

I have a data grid view that if a user selects a specific row then can select copy and it will add the first columns data to the clipboard. I need help with if the user selects multiple columns it will add the first colmns data for each item. Below is the code im using.

Dim IntName
Dim i As Integer

i = Completed_DGV.CurrentRow.Index
IntName = Completed_DGV.Item(0, i).Value

Clipboard.SetDataObject(IntName)

推荐答案

剪贴板不接受很多值.因此,您需要将这些值连接为一个,并设置一个值(表示您想要的所有值)成为剪贴板中的值.
The clipboard does not accept many values. So you need to concatenate those values in to one, and set that one value, being a representation of all the values you want, to be what is in the clipboard.


这篇关于将多个项目从数据网格复制到剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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