I have a method/sub that takes an object as a parameter, then it scans through a panels controls and trys to find if it is in the window.
but yet it gives me a type 'types' is not define
VB.NET:
Public Sub removetype (ByVal findobject As Object)
Dim types As System.Type = findobject.GetType
For Each ThisCtrl In Flow.Controls 'flow is a panel
Console.WriteLine("scanning...")
If TypeOf ThisCtrl Is types Then ' type types is not defined
Console.WriteLine("found: " & ThisCtrl.GetType().ToString)
Try
Flow.Controls.Remove(ThisCtrl)
Return
Catch ex As Exception
Console.WriteLine("not removed")
End Try
End If
Next
Console.WriteLine("...done scan")
End Sub
but yet it gives me a type 'types' is not define
Last edited: