Solved

FileOpen Class not defined

Posted on 2004-09-15
2
277 Views
Last Modified: 2006-11-17
I am new to VB.NET and am studying listbox related code.  When attempting to implement some samples I get FileOpen not defined.  Here is a code 'snippet'

Private Sub lstSelectedParents_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstSelectedParents.SelectedIndexChanged
        Try
            Dim aIndices(lstParent.SelectedIndices.Count - 1) As Integer
            lstParent.SelectedIndices.CopyTo(aIndices, 0)
            lstSelectedParents.DataSource = aIndices ' Adds users selections to another listbox

            With lstSelectedParents
                .Items.Clear()
                .BeginUpdate()
                Dim fi As FileInfo '*** Here is the problem
                For Each fi In lstSelectedParents.SelectedItems
                    .Items.Add(fi.Name)
                Next
                .EndUpdate()
            End With
        Catch ex As Exception
            lstSelectedParents.DataSource = Nothing
        End Try
0
Comment
Question by:bentleyeric
2 Comments
 
LVL 7

Assisted Solution

by:natloz
natloz earned 250 total points
ID: 12068728
At the top of the form you need...

Imports System.IO.FileInfo
0
 
LVL 27

Accepted Solution

by:
planocz earned 250 total points
ID: 12068754
or Just do..

Imports System.IO
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question