[VB.NET]用Extension Method移除控制項
Public Module ControlExtension
#Region “Public Method” <Extension()> _ Public Sub Remove(ByVal ctrl As Control) Dim parent As Control = ctrl.Parent If parent Is Nothing Then Return End If parent.Controls.Remove(ctrl) End Sub #End Region
End Module