DataGrid.Dispose(Boolean) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
處置 DataGrid.
protected:
override void Dispose(bool disposing);
protected override void Dispose(bool disposing);
override this.Dispose : bool -> unit
Protected Overrides Sub Dispose (disposing As Boolean)
參數
- disposing
- Boolean
true 釋放可管理與非受管理資源; false 只釋放未管理的資源。
範例
以下程式碼範例使用了 Dispose 釋放資源的方法。
Private Sub DisposeGridResources(ByVal myGrid As DataGrid)
myGrid.Dispose
myGrid = Nothing
End Sub
備註
使用完Dispose後再打電話System.Windows.Forms.DataGrid。 此 Dispose 方法會使 在 System.Windows.Forms.DataGrid 無法使用的狀態下。 呼叫 Dispose後,你必須釋放所有對 的 System.Windows.Forms.DataGrid 引用,這樣它所佔據的記憶體才能透過垃圾回收回收。