Click here to Skip to main content
15,894,180 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Two way Data synchronization mssql 2008 express Pin
Ashfield14-Apr-09 21:07
Ashfield14-Apr-09 21:07 
QuestionAppActivate and Send Keys not working correctly Pin
CARisk314-Apr-09 12:29
CARisk314-Apr-09 12:29 
AnswerRe: AppActivate and Send Keys not working correctly Pin
Dave Kreskowiak15-Apr-09 2:23
mveDave Kreskowiak15-Apr-09 2:23 
GeneralRe: AppActivate and Send Keys not working correctly Pin
CARisk315-Apr-09 3:27
CARisk315-Apr-09 3:27 
GeneralFind some code but not understanding it Pin
CARisk315-Apr-09 8:26
CARisk315-Apr-09 8:26 
QuestionVB.net Listbox: load listbox from folder, show only file name, click to open file in textbox Pin
trujade14-Apr-09 12:12
trujade14-Apr-09 12:12 
AnswerRe: VB.net Listbox: load listbox from folder, show only file name, click to open file in textbox Pin
Christian Graus14-Apr-09 22:09
protectorChristian Graus14-Apr-09 22:09 
AnswerRe: VB.net Listbox: load listbox from folder, show only file name, click to open file in textbox Pin
trujade12-Dec-09 5:24
trujade12-Dec-09 5:24 
here is the solution to my question.

new project, 2 textboxes, 1 button, 1 listbox.


Public Class Form1

    '-- create a string for the folder path
    Dim myDirectory As String

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Button1.Text = "select folder"
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim fbd As New FolderBrowserDialog
        fbd.RootFolder = Environment.SpecialFolder.Desktop
        If fbd.ShowDialog = DialogResult.OK Then
            '-- set the directory for use to load each file from the folder
            myDirectory = fbd.SelectedPath
        End If
        '-- load files in listbox, filenames only
        For Each file As String In My.Computer.FileSystem.GetFiles _
            (myDirectory, FileIO.SearchOption.SearchTopLevelOnly, "*.txt")
            ListBox1.Items.Add(System.IO.Path.GetFileNameWithoutExtension(file))
        Next
        ListBox1.Select()
    End Sub

    Private Sub ListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick
        Try
            Dim myFile As String = myDirectory & "\" & ListBox1.SelectedItem & ".txt"
            '-- file content
            TextBox1.Text = IO.File.ReadAllText(myFile)
            '-- file name w/extension
            TextBox2.Text = IO.Path.GetFileName(myFile)
        Catch ex As Exception
        End Try
    End Sub

End Class

QuestionVisual Studio 2008 Web Browser Control Pin
AndyASPVB14-Apr-09 11:15
AndyASPVB14-Apr-09 11:15 
AnswerRe: Visual Studio 2008 Web Browser Control Pin
Christian Graus14-Apr-09 22:11
protectorChristian Graus14-Apr-09 22:11 
AnswerRe: Visual Studio 2008 Web Browser Control Pin
Andy Missico15-Apr-09 1:51
Andy Missico15-Apr-09 1:51 
QuestionUnable to emit assembly: Referenced assembly 'Interop.ADODB' does not have a strong name Pin
MarcelloTurnbull14-Apr-09 8:46
MarcelloTurnbull14-Apr-09 8:46 
AnswerRe: Unable to emit assembly: Referenced assembly 'Interop.ADODB' does not have a strong name Pin
Andy Missico15-Apr-09 0:29
Andy Missico15-Apr-09 0:29 
QuestionFile Search Pin
anandbpsri14-Apr-09 7:02
anandbpsri14-Apr-09 7:02 
Answerignore! Pin
Luc 64801114-Apr-09 7:27
Luc 64801114-Apr-09 7:27 
AnswerRe: File Search Pin
Yusuf14-Apr-09 12:03
Yusuf14-Apr-09 12:03 
AnswerRe: File Search Pin
Dalek Dave14-Apr-09 22:19
professionalDalek Dave14-Apr-09 22:19 
GeneralFile Searching [moved] Pin
anandbpsri14-Apr-09 7:01
anandbpsri14-Apr-09 7:01 
GeneralRe: File Searching Pin
Eytukan14-Apr-09 7:17
Eytukan14-Apr-09 7:17 
AnswerRe: File Searching [moved] Pin
0x3c014-Apr-09 10:26
0x3c014-Apr-09 10:26 
QuestionCreate new insatance of Visual Basic Class Pin
Deepak the Cool14-Apr-09 1:33
Deepak the Cool14-Apr-09 1:33 
AnswerRe: Create new insatance of Visual Basic Class Pin
Dave Kreskowiak14-Apr-09 5:32
mveDave Kreskowiak14-Apr-09 5:32 
Questioninvoke batch file from server Pin
p_196014-Apr-09 1:04
p_196014-Apr-09 1:04 
AnswerRe: invoke batch file from server Pin
Dave Kreskowiak14-Apr-09 5:24
mveDave Kreskowiak14-Apr-09 5:24 
GeneralRe: invoke batch file from server Pin
p_196014-Apr-09 6:23
p_196014-Apr-09 6:23 

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.