DataGridViewCell.Clone DataGridViewCell.Clone DataGridViewCell.Clone DataGridViewCell.Clone Method

定義

建立與這個儲存格完全相同的複本。Creates an exact copy of this cell.

public:
 virtual System::Object ^ Clone();
public virtual object Clone ();
abstract member Clone : unit -> obj
override this.Clone : unit -> obj
Public Overridable Function Clone () As Object

傳回

Object,表示複製的 DataGridViewCellAn Object that represents the cloned DataGridViewCell.

實作

備註

每當您衍生DataGridViewCell自類別,並將新的屬性加入至衍生類別時,覆寫方法。CloneOverride the Clone method whenever you derive from the DataGridViewCell class and add new properties to the derived class.

給繼承者的注意事項

覆寫衍生Clone()類別中的方法時,呼叫基類的Clone()方法,以便將基類的屬性複製到新的資料格,並務必同時複製已加入至衍生類別之任何屬性的值。When overriding the Clone() method in a derived class, call the base class's Clone() method so that the properties of the base class are copied to the new cell, and be sure to also copy the values of any properties that were added to the derived class.

適用於

另請參閱