DataGridCell.ToString 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取单元格的行号和列号。
public:
override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
返回
包含行号和列号的字符串。
示例
下面的示例使用 DataGridCell 对象的 方法返回控件的 ToStringCurrentCell 行号System.Windows.Forms.DataGrid。
private:
void Grid_MouseUp(
Object^ sender, System::Windows::Forms::MouseEventArgs^ /*e*/ )
{
DataGrid^ dg = (DataGrid^)(sender);
DataGridCell myCell = dg->CurrentCell;
Console::WriteLine( myCell.ToString() );
}
private void Grid_MouseUp
(object sender, System.Windows.Forms.MouseEventArgs e)
{
DataGrid dg = (DataGrid)sender;
DataGridCell myCell = dg.CurrentCell;
Console.WriteLine(myCell.ToString());
}
Private Sub DataGrid1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Dim myGrid As DataGrid = CType(sender, DataGrid)
Dim myCell As DataGridCell = myGrid.CurrentCell
Console.WriteLine(myCell.ToString)
End Sub