Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

FileOpen Class not defined

Posted on 2004-09-15
2
Medium Priority
?
282 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 1000 total points
ID: 12068728
At the top of the form you need...

Imports System.IO.FileInfo
0
 
LVL 27

Accepted Solution

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

Imports System.IO
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Screencast - Getting to Know the Pipeline
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

783 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