|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Error when 'option strict'ByVal e As System.Windows.Forms.DragEventArgs) Handles FlowLayoutPanel1.DragDrop If e.Data.GetDataPresent(DataFormats.FileDrop) Then Dim fullFilenames() As String fullFilenames = e.Data.GetData(DataFormats.FileDrop) End If End Sub Line 'fullFilenames = e.Data.GetData(DataFormats.FileDrop)' give the Error 'Option Strict On disallows implicit conversions from 'Object' to '1-dimensional array of String' I must disable 'Option strict' to continue... What must I change to avoid this error ? Thanks for your attention Philip GetData returns an Object. If it's really a string array, then you
need to cast it by calling DirectCast: fullFilenames = DirectCast(e.Data.GetData(DataFormats.FileDrop),String()) Perfect !
Thanks sincerely. Option is again 'strict' without error. I'm happy ! "Chris Dunaway" <dunaw***@gmail.com> a écrit dans le message de news: 1139321282.365767.285***@g47g2000cwa.googlegroups.com...Show quoteHide quote > GetData returns an Object. If it's really a string array, then you > need to cast it by calling DirectCast: > > fullFilenames = > DirectCast(e.Data.GetData(DataFormats.FileDrop),String()) >
ADO.net + MS Access = performance issues
VB.NET Structures and Union Help. how to group similar events? 2nd Post: Problem adding events to controls created at run-time KeyUp + KeyDown Event Handler Problems with ByRef parameters Copying files across network String vs. Stringbuilder speed parsing questio System.IO.FileSystemWatcher is missing alot of files. continue debugging without interrupting |
|||||||||||||||||||||||