ImageListStreamer.Dispose 方法


釋放 ImageListStreamer 類別目前的執行個體所使用的全部資源。Releases all resources used by the current instance of the ImageListStreamer class.

 virtual void Dispose();
public void Dispose ();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Sub Dispose ()



Dispose 使用完畢時,請呼叫 ImageListStreamerCall Dispose when you are finished using the ImageListStreamer. Dispose 方法會將 ImageListStreamer 保留在無法使用的狀態。The Dispose method leaves the ImageListStreamer in an unusable state. 呼叫Dispose之後, 您必須釋放所有對的ImageListStreamer參考, 讓垃圾收集行程可以ImageListStreamer回收所佔用的記憶體。After calling Dispose, you must release all references to the ImageListStreamer so the garbage collector can reclaim the memory that the ImageListStreamer was occupying.

如需詳細資訊, 請參閱清除非受控資源執行 Dispose 方法For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.


在您釋放最後一個 Dispose 參考之前,請務必呼叫 ImageListStreamerAlways call Dispose before you release your last reference to the ImageListStreamer. 否則工作窗格所使用的資源不會釋放,直到記憶體回收行程呼叫 ImageListStreamer 物件的 Finalize 方法。Otherwise, the resources it is using will not be freed until the garbage collector calls the ImageListStreamer object's Finalize method.