Just one point I would mention there is that this code is wrong:
vb.net Code:
Dim filenames As String() = TryCast(e.Data.GetData(DataFormats.FileDrop), String())
Dim filetype As String = filenames(0).Substring(filenames(0).LastIndexOf("") + 1)
The whole point of TryCast is to attempt a cast that might fail without throwing an exception so you should never assume that TryCast produces a result. TryCast should ALWAYS be followed by a null check because it will produce Nothing if the cast failed:
vb.net Code:
Dim filenames As String() = TryCast(e.Data.GetData(DataFormats.FileDrop), String())
If filenames IsNot Nothing Then
Dim filetype As String = filenames(0).Substring(filenames(0).LastIndexOf("") + 1)
If you know for a fact that the cast will not fail then you should not be using TryCast at all, but rather DirectCast:
vb.net Code:
Dim filenames As String() = DirectCast(e.Data.GetData(DataFormats.FileDrop), String())
Dim filetype As String = filenames(0).Substring(filenames(0).LastIndexOf("") + 1)