DataGridViewRowHeaderCell.GetClipboardContent 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
检索要复制到 Clipboard 的单元格的已设置格式的值。
protected:
override System::Object ^ GetClipboardContent(int rowIndex, bool firstCell, bool lastCell, bool inFirstRow, bool inLastRow, System::String ^ format);
protected override object GetClipboardContent(int rowIndex, bool firstCell, bool lastCell, bool inFirstRow, bool inLastRow, string format);
protected override object? GetClipboardContent(int rowIndex, bool firstCell, bool lastCell, bool inFirstRow, bool inLastRow, string format);
override this.GetClipboardContent : int * bool * bool * bool * bool * string -> obj
Protected Overrides Function GetClipboardContent (rowIndex As Integer, firstCell As Boolean, lastCell As Boolean, inFirstRow As Boolean, inLastRow As Boolean, format As String) As Object
- rowIndex
- Int32
包含该单元格的行从零开始的索引。
- firstCell
- Boolean
若单元格位于由选定单元格定义的区域的第一列,则为 true
;否则为 false
。
- lastCell
- Boolean
若单元格位于由选定单元格定义的区域的最后一列,则为 true
;否则为 false
。
- inFirstRow
- Boolean
若单元格位于由选定单元格定义的区域的第一行,则为 true
;否则为 false
。
- inLastRow
- Boolean
如果该单元格位于选定单元格所定义区域内的最后一行中,则为 true
;否则为 false
。
- format
- String
单元格的当前格式字符串。
Object,它表示要复制到 Clipboard 的单元格的值。
rowIndex
小于零,或者大于或等于控件中的行数。
根据控件的 ClipboardCopyModeDataGridView 属性的值,此方法由控件的 GetClipboardContent 方法调用,以检索表示单元格的剪贴板格式的值。
此方法的位置相关参数指示此单元格在数据表中的位置,该数据表表示控件中 DataGridView 选定单元格定义的区域。 根据单元格的位置,除单元格值外,此方法可能还会返回格式设置信息。 例如,行第一列中单元格的 HTML 格式将包含指示行开头的 标记。
支持的剪贴板格式包括 DataFormats.Text、 DataFormats.UnicodeText、 DataFormats.Html和 DataFormats.CommaSeparatedValue。
有关更多信息,请参见 Clipboard 类。
产品 | 版本 |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |