DataGridCell(Int32, Int32) 建構函式

定義

初始化 DataGridCell 類別的新執行個體。

public:
 DataGridCell(int r, int c);
public DataGridCell (int r, int c);
new System.Windows.Forms.DataGridCell : int * int -> System.Windows.Forms.DataGridCell
Public Sub New (r As Integer, c As Integer)

參數

r
Int32

DataGrid 中的資料列編號。

c
Int32

DataGrid 中的資料行編號。

範例

下列範例會建立 , DataGridCell 並將新的 實例設定為 CurrentCell 控制項的 System.Windows.Forms.DataGrid

private:
   void SetCell()
   {
      // Set the focus to the cell specified by the DataGridCell.
      DataGridCell dc;
      dc.RowNumber = 1;
      dc.ColumnNumber = 1;
      dataGrid1->CurrentCell = dc;
   }
private void SetCell()
{
   // Set the focus to the cell specified by the DataGridCell.
   DataGridCell dc = new DataGridCell();
   dc.RowNumber = 1;
   dc.ColumnNumber = 1;
   dataGrid1.CurrentCell = dc;
}
Private Sub SetCell()
   ' Set the focus to the cell specified by the DataGridCell.
   Dim dc As DataGridCell
   dc.RowNumber = 1
   dc.ColumnNumber = 1
   DataGrid1.CurrentCell = dc
End Sub

適用於

另請參閱