DataGridViewRowHeaderCell.GetClipboardContent 方法

定義

擷取儲存格的已格式化的值,以複製到 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 小於零,或大於等於控制項的資料列數目。

備註

根據控制項的 ClipboardCopyMode 屬性值 DataGridView ,控制項 GetClipboardContent 的 方法會呼叫這個方法,以擷取代表儲存格的剪貼簿格式值。

這個方法的位置相關參數會指出這個儲存格位於資料表中,代表控制項中 DataGridView 所選儲存格所定義的區域。 根據儲存格的位置,除了儲存格值之外,此方法還會傳回格式化資訊。 例如,資料列第一欄儲存格的 HTML 格式會包含指出資料列開頭的標記。

支援的剪貼簿格式包括 DataFormats.TextDataFormats.UnicodeTextDataFormats.HtmlDataFormats.CommaSeparatedValue

如需詳細資訊,請參閱 Clipboard 類別。

適用於

另請參閱