Click here to Skip to main content
16,011,949 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: PNG-8? Pin
Christian Graus30-Jan-07 9:08
protectorChristian Graus30-Jan-07 9:08 
Questioncopy files to a remote server Pin
steve_rm30-Jan-07 4:53
steve_rm30-Jan-07 4:53 
AnswerRe: copy files to a remote server Pin
Norberto Olazabal30-Jan-07 5:26
Norberto Olazabal30-Jan-07 5:26 
QuestionRe: copy files to a remote server [modified] Pin
steve_rm30-Jan-07 16:41
steve_rm30-Jan-07 16:41 
AnswerRe: copy files to a remote server Pin
Norberto Olazabal31-Jan-07 2:26
Norberto Olazabal31-Jan-07 2:26 
QuestionPassing a parameter into Crystal Reports via an Asp.net Webpage Pin
bazpaul30-Jan-07 4:52
bazpaul30-Jan-07 4:52 
QuestionHow do I list all the files in a folder and select one. Pin
directred30-Jan-07 4:49
directred30-Jan-07 4:49 
AnswerRe: How do I list all the files in a folder and select one. Pin
MatrixCoder30-Jan-07 7:55
MatrixCoder30-Jan-07 7:55 
You would want to use a ComboBox and a ListBox for this. Like so:

Private Sub DriveComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DriveComboBox.SelectedIndexChanged
    FolderListBox.Items.Clear()
  For Each Dir As String In My.Computer.FileSystem.GetDirectories(DriveComboBox.SelectedItem, FileIO.SearchOption.SearchTopLevelOnly)
     FolderListBox.Items.Add(Dir)
  Next
End Sub

Private Sub FolderListBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FolderListBox.SelectedIndexChanged
    FileListBox.Items.Clear()
  For Each File As String In My.Computer.FileSystem.GetFiles(FolderListBox.SelectedItem, FileIO.SearchOption.SearchTopLevelOnly)
    FileListBox.Items.Add(File)
  Next
End Sub

Private Sub FileListBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FileListBox.SelectedIndexChanged
  MsgBox(FileListBox.SelectedItem)
End Sub


The DriveListBox, DirListBox and the FileListBox are not what you would want to use for this. Microsoft doesn't even offer support for these controls anymore. Plus, ListBoxes are a lot more customizable.

Hope this helps.







Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.

GeneralRe: How do I list all the files in a folder and select one. Pin
directred31-Jan-07 8:37
directred31-Jan-07 8:37 
GeneralRe: How do I list all the files in a folder and select one. Pin
directred1-Feb-07 4:14
directred1-Feb-07 4:14 
GeneralRe: How do I list all the files in a folder and select one. Pin
MatrixCoder1-Feb-07 4:52
MatrixCoder1-Feb-07 4:52 
QuestionNeed input on the best way of going about this......... Pin
Joey Picerno30-Jan-07 4:14
Joey Picerno30-Jan-07 4:14 
AnswerRe: Need input on the best way of going about this......... Pin
Christian Graus30-Jan-07 9:09
protectorChristian Graus30-Jan-07 9:09 
GeneralRe: Need input on the best way of going about this......... Pin
Joey Picerno1-Feb-07 9:30
Joey Picerno1-Feb-07 9:30 
GeneralRe: Need input on the best way of going about this......... Pin
Christian Graus1-Feb-07 10:23
protectorChristian Graus1-Feb-07 10:23 
Questiondispose object Pin
Sebastian T Xavier30-Jan-07 3:37
Sebastian T Xavier30-Jan-07 3:37 
AnswerRe: dispose object Pin
Norberto Olazabal30-Jan-07 5:27
Norberto Olazabal30-Jan-07 5:27 
GeneralRe: dispose object Pin
Guffa30-Jan-07 6:17
Guffa30-Jan-07 6:17 
GeneralRe: dispose object Pin
Sebastian T Xavier30-Jan-07 20:16
Sebastian T Xavier30-Jan-07 20:16 
QuestionHyperlink and Report Pin
Sarfaraj Ahmed30-Jan-07 3:32
Sarfaraj Ahmed30-Jan-07 3:32 
QuestionPrinting an image at true format Pin
Zaegra30-Jan-07 3:19
Zaegra30-Jan-07 3:19 
AnswerRe: Printing an image at true format Pin
Christian Graus30-Jan-07 9:12
protectorChristian Graus30-Jan-07 9:12 
GeneralAuthenticate to AD Pin
Member 373099930-Jan-07 2:53
Member 373099930-Jan-07 2:53 
QuestionForm Question. Pin
jady8430-Jan-07 2:43
jady8430-Jan-07 2:43 
AnswerRe: Form Question. Pin
Nilesh Hapse30-Jan-07 3:16
Nilesh Hapse30-Jan-07 3:16 

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.