DataGridViewColumnHeaderCell.GetClipboardContent(Int32, Boolean, Boolean, Boolean, Boolean, String) DataGridViewColumnHeaderCell.GetClipboardContent(Int32, Boolean, Boolean, Boolean, Boolean, String) DataGridViewColumnHeaderCell.GetClipboardContent(Int32, Boolean, Boolean, Boolean, Boolean, String) DataGridViewColumnHeaderCell.GetClipboardContent(Int32, Boolean, Boolean, Boolean, Boolean, String) Method

定义

检索要复制到 Clipboard 的单元格的已设置格式的值。Retrieves the formatted value of the cell to copy to the 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);
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 Int32 Int32 Int32

包含该单元格的行从零开始的索引。The zero-based index of the row containing the cell.

firstCell
Boolean Boolean Boolean Boolean

若单元格位于由选定单元格定义的区域的第一列,则为 true;否则为 falsetrue to indicate that the cell is in the first column of the region defined by the selected cells; otherwise, false.

lastCell
Boolean Boolean Boolean Boolean

若单元格位于由选定单元格定义的区域的最后一列,则为 true;否则为 falsetrue to indicate that the cell is the last column of the region defined by the selected cells; otherwise, false.

inFirstRow
Boolean Boolean Boolean Boolean

若单元格位于由选定单元格定义的区域的第一行,则为 true;否则为 falsetrue to indicate that the cell is in the first row of the region defined by the selected cells; otherwise, false.

inLastRow
Boolean Boolean Boolean Boolean

如果该单元格位于选定单元格所定义区域内的最后一行中,则为 true;否则为 falsetrue to indicate that the cell is in the last row of the region defined by the selected cells; otherwise, false.

format
String String String String

单元格的当前格式字符串。The current format string of the cell.

返回

Object,它表示要复制到 Clipboard 的单元格的值。A Object that represents the value of the cell to copy to the Clipboard.

异常

注解

具体取决于值ClipboardCopyMode的属性DataGridView由该控件的控件,调用此方法是GetClipboardContent方法检索剪贴板格式的表示的单元格的值。Depending on the value of the ClipboardCopyMode property of the DataGridView control, this method is called by the control's GetClipboardContent method to retrieve a clipboard-formatted value that represents the cell.

此方法与位置相关的参数指示此单元格位于由选定单元格中定义的区域表示的数据的表的DataGridView控件。The position-related parameters of this method indicate where this cell is located in the table of data representing the region defined by the selected cells in the DataGridView control. 具体取决于单元格的位置,格式设置信息可能是此方法返回除了单元格的值。Depending on the cell's position, formatting information may be returned by this method in addition to the cell value. 例如,某一行的第一列中的单元格的 HTML 格式将包括指示某一行的开头的标记。For example, the HTML format for a cell in the first column of a row will include the tag that indicates the beginning of a row.

受支持的剪贴板格式包括DataFormats.TextDataFormats.UnicodeTextDataFormats.Html,和DataFormats.CommaSeparatedValueThe supported clipboard formats include DataFormats.Text, DataFormats.UnicodeText, DataFormats.Html, and DataFormats.CommaSeparatedValue.

有关更多信息,请参见 Clipboard 类。For more information, see the Clipboard class.

适用于

另请参阅