DataGridViewButtonCell.GetValue(Int32) 方法

定義

擷取與按鈕關聯的文字。

protected:
 override System::Object ^ GetValue(int rowIndex);
protected override object GetValue (int rowIndex);
protected override object? GetValue (int rowIndex);
override this.GetValue : int -> obj
Protected Overrides Function GetValue (rowIndex As Integer) As Object

參數

rowIndex
Int32

儲存格的父資料列索引。

傳回

DataGridViewButtonCell 的值,如果 Texttrue 則為主控資料行的 UseColumnTextForButtonValue 值。

備註

這個方法很適合用來擷取共用數據列中儲存格的文字,這無法在本機儲存單元格值並維持共享狀態。 您必須傳入實際數據列索引,因為共用數據列的索引為 -1。 如需數據列共用的詳細資訊,請參閱調整 dataGridView 控件 Windows Forms 最佳做法

適用於

另請參閱