Επεξεργασία

Κοινή χρήση μέσω


DataGridViewRowHeaderCell.GetClipboardContent Method

Definition

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);
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

Parameters

rowIndex
Int32

The zero-based index of the row containing the cell.

firstCell
Boolean

true to indicate that the cell is in the first column of the region defined by the selected cells; otherwise, false.

lastCell
Boolean

true to indicate that the cell is the last column of the region defined by the selected cells; otherwise, false.

inFirstRow
Boolean

true to indicate that the cell is in the first row of the region defined by the selected cells; otherwise, false.

inLastRow
Boolean

true to indicate that the cell is in the last row of the region defined by the selected cells; otherwise, false.

format
String

The current format string of the cell.

Returns

A Object that represents the value of the cell to copy to the Clipboard.

Exceptions

rowIndex is less than zero or greater than or equal to the number of rows in the control.

Remarks

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.

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. 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.

The supported clipboard formats include DataFormats.Text, DataFormats.UnicodeText, DataFormats.Html, and DataFormats.CommaSeparatedValue.

For more information, see the Clipboard class.

Applies to

See also