Click here to Skip to main content
15,851,711 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Need help with a project, I am really stumped! Pin
Sam Xavier29-May-08 0:26
Sam Xavier29-May-08 0:26 
GeneralRe: Need help with a project, I am really stumped! Pin
Ogre72229-May-08 3:41
Ogre72229-May-08 3:41 
GeneralRe: Need help with a project, I am really stumped! Pin
Chinners29-May-08 4:14
Chinners29-May-08 4:14 
GeneralRe: Need help with a project, I am really stumped! Pin
Ogre72229-May-08 5:26
Ogre72229-May-08 5:26 
GeneralRe: Need help with a project, I am really stumped! Pin
Chinners29-May-08 5:57
Chinners29-May-08 5:57 
GeneralRe: Need help with a project, I am really stumped! Pin
Ogre72229-May-08 6:22
Ogre72229-May-08 6:22 
GeneralRe: Need help with a project, I am really stumped! Pin
Ogre72229-May-08 16:47
Ogre72229-May-08 16:47 
GeneralRe: Need help with a project, I am really stumped! Pin
Chinners29-May-08 23:35
Chinners29-May-08 23:35 
Looking at it in a bit more detail, you can actually put an object of type "FileInfo" into a listbox, and it will have the same functionality:

Dim dir As String = "C:\"
Dim search As DirectoryInfo = New DirectoryInfo("c:\Windows\") '(dir & ":\")
For Each file As FileInfo In search.GetFiles("*.*", SearchOption.AllDirectories)
   ListBox1.Items.Add(file)
Next



and in the click handler:

Public Sub DisplayInfo(ByVal sender As Object, ByVal e As EventArgs) Handles ListBox1.Click
   If ListBox1.SelectedIndices.Count > 0 Then
      For Each i As Integer In ListBox1.SelectedIndices
         Dim o As Object = ListBox1.Items(i)
         If TypeOf o Is FileInfo Then
            MessageBox.Show(DirectCast(o, FileInfo).FullName)
         End If
      Next
   End If
End Sub


Maybe that is more suitable? It will keep the whole FileInfo block in the listbox.
GeneralRe: Need help with a project, I am really stumped! Pin
Steven J Jowett29-May-08 5:07
Steven J Jowett29-May-08 5:07 
QuestionCheck tinytext column in MySQL Database with VB.NET Pin
drexler_kk28-May-08 16:17
drexler_kk28-May-08 16:17 
AnswerRe: Check tinytext column in MySQL Database with VB.NET Pin
jzonthemtn29-May-08 3:36
jzonthemtn29-May-08 3:36 
QuestionTrouble with VB.NET and XPath Pin
Dominick Marciano28-May-08 10:45
professionalDominick Marciano28-May-08 10:45 
AnswerRe: Trouble with VB.NET and XPath Pin
MidwestLimey28-May-08 14:26
professionalMidwestLimey28-May-08 14:26 
GeneralRe: Trouble with VB.NET and XPath Pin
Dominick Marciano29-May-08 7:43
professionalDominick Marciano29-May-08 7:43 
GeneralRe: Trouble with VB.NET and XPath Pin
MidwestLimey29-May-08 9:19
professionalMidwestLimey29-May-08 9:19 
QuestionbackgroundWorker Help Pin
Cory Kimble28-May-08 8:35
Cory Kimble28-May-08 8:35 
AnswerRe: backgroundWorker Help Pin
Kschuler28-May-08 9:30
Kschuler28-May-08 9:30 
GeneralRe: backgroundWorker Help Pin
Cory Kimble28-May-08 11:47
Cory Kimble28-May-08 11:47 
GeneralRe: backgroundWorker Help Pin
Kschuler28-May-08 11:57
Kschuler28-May-08 11:57 
AnswerRe: backgroundWorker Help Pin
Chinners29-May-08 0:05
Chinners29-May-08 0:05 
QuestionGraphics question Pin
sa_runner28-May-08 6:27
sa_runner28-May-08 6:27 
AnswerRe: Graphics question Pin
Chinners28-May-08 6:57
Chinners28-May-08 6:57 
GeneralRe: Graphics question Pin
sa_runner28-May-08 12:41
sa_runner28-May-08 12:41 
QuestionTurning a functional (not object-oriented) program into a .dll Pin
Eric Burns28-May-08 5:52
Eric Burns28-May-08 5:52 
AnswerRe: Turning a functional (not object-oriented) program into a .dll Pin
Steven J Jowett28-May-08 6:54
Steven J Jowett28-May-08 6:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.