Solved

FileOpen Class not defined

Posted on 2004-09-15
2
276 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 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