DataGridCell::GetHashCode Method ()
.NET Framework (current version)
Gets a hash value that can be added to a Hashtable.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The following example adds the hash value of the selected cell in a System.Windows.Forms::DataGrid control to a Hashtable.
private: Hashtable^ myHashTable; public: Form1() { myHashTable = gcnew Hashtable; } private: void Grid_MouseUp( Object^ sender, System::Windows::Forms::MouseEventArgs^ /*e*/ ) { DataGrid^ dg = dynamic_cast<DataGrid^>(sender); DataGridCell myCell = dg->CurrentCell; String^ tempkey = myCell.ToString(); Console::WriteLine( "Temp {0}", tempkey ); if ( myHashTable->Contains( tempkey ) ) { return; } myHashTable->Add( tempkey, myCell.GetHashCode() ); Console::WriteLine( "Hashcode: {0}", myCell.GetHashCode() ); }
.NET Framework
Available since 1.1
Available since 1.1
Show: