Results 1 to 2 of 2

Thread: Starting exe from listbox from a specific location

  1. #1
    Scott is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.0
    Join Date
    Jun 2012
    Posts
    1
    Reputation
    0

    Starting exe from listbox from a specific location

    Hello all,

    I am really new at this, but so far I have managed editting some excisting code and I am trying to build my own little nifty program now in VB 2008 Express.

    The goal of the program is to get it to look in different network locations and from a listbox be able to start a program from that network location via a double click in the listbox.

    So to make it short:

    - I read networkpaths from a txt file (\\a\directory, \\b\directory) and those locations are presented in the listbox
    - These network locations all contain an executable but they have the same name (\\a\directory\program.exe, \\b\directory\program.exe, etc)

    So far I have come up with " System.Diagnostics.Process.Start("programname")" which starts a program, but my goal is (after a double click on an entry) to get the application to look at the entry in the listbox itself, see which network location it refers to and then start the executable in that location.

    Can anyone give me a kick in the right direction? I am still very new at this, but I do believe I pick up quickly...

    Thanks in advance!!!

    Scott

  2. #2
    dHeather is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0
    Join Date
    Jun 2012
    Posts
    26
    Reputation
    14
    Hello,

    If you use a ListView as oppose to a ListBox I think what you are trying to do is this:

    PrivateSub ListView1_MouseDoubleClick(ByVal sender AsObject, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick
    Process.Start(Me.ListView1.SelectedItems(0).Text)
    EndSub

    This is assuming that the full file path and name are stored in your ListView.

    Hope that helps

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking