1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. The forum has been upgraded to a more recent and user-friendly software, called "XenForo".
    It will take some time to get everything set up and running smoothly, so please report any bug you may find to the forum staff.
    Thank you for your patience.

[VB.net] An Offline Program?

Discussion in 'Code Snippets and Tutorials' started by singapore, May 14, 2010.

  1. singapore

    singapore New Member

    Joined:
    Jan 4, 2010
    Messages:
    554
    Likes Received:
    10
    Hello all..

    so, i just recently started out on VB:)..therefore i REALLY know absolutely NOTHING about VB for now..but i hope with the guidance of all the great programmers here, i can at least make a decent program using VB:D..

    (PS: The program that i wanna create ultimately is for offline use only..at least for now it will be:))

    so, I am currently having this problem..

    I wanna include a list of programs to open after i login to my system and I the problem now is that i do not know how to cre8 a button that have the "browse your computer" function..

    after selecting the programs that I want, I would prefer them to be shown in a box and with another button to save the list..

    i hope my xplanation is clear enough..

    many thanks in advance:)..
     
  2. tharoux

    tharoux Well-Known Member

    Joined:
    Dec 30, 2006
    Messages:
    2,733
    Likes Received:
    126
    Location:
    In front of my PC, Montreal
    I don't really understand...
    Maybe a little MSPaint drawing to give a general idea ?
     
  3. singapore

    singapore New Member

    Joined:
    Jan 4, 2010
    Messages:
    554
    Likes Received:
    10
    Here goes:)..

    feel free to post/pm me any other things that u do not understand from my explanation:)..
     

    Attached Files:

  4. tharoux

    tharoux Well-Known Member

    Joined:
    Dec 30, 2006
    Messages:
    2,733
    Likes Received:
    126
    Location:
    In front of my PC, Montreal
    ok, seem clear. One last question, why so many edit button ?
    if you have a list, you can manage everything from there.

    But back on the initial request...
    If you still need a "browse" window function, lemme know, I've got one.
     
  5. singapore

    singapore New Member

    Joined:
    Jan 4, 2010
    Messages:
    554
    Likes Received:
    10
    coz they are all of different settings.

    for example the 1st should be "Firefox","Windows Media Player","Game"

    the 2nd can be "Chrome","VLC player","Game 2"

    tats the reason for multiple edit buttons:)..

    yeah i need the code for the browse button..preferably with comments too so that i know what is going on:p..

    thanks in advance Thar.

    will be PMing u with further questions regarding this since u already know about it:D..haha
     
  6. tharoux

    tharoux Well-Known Member

    Joined:
    Dec 30, 2006
    Messages:
    2,733
    Likes Received:
    126
    Location:
    In front of my PC, Montreal
    Like I said, you don't need so many edit. Just use a listbox and you can than easily manage what you need.
    You'll even be able to say witch program to open first, easily remove one and save the list quite easily.

    And here's the code :
    Code (Text):
    1. Private Sub cmdILoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdILoad.Click
    2.         Dim OpenFileDialog1 As New OpenFileDialog() 'Declare the new FileDialog
    3.         OpenFileDialog1.InitialDirectory = System.AppDomain.CurrentDomain.BaseDirectory() 'Put the initial directory where the program is
    4.         OpenFileDialog1.Filter = "All files (*.*)|*.*|Text files (*.exe)|*.exe" 'Filter all the file for EXE only
    5.         OpenFileDialog1.FilterIndex = 2
    6.         OpenFileDialog1.RestoreDirectory = True
    7.         If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then 'If the user choose a file, will proceed
    8.             'OpenFileDialog1.FileName.ToString    'Using this line, it will return the complete path where the file is. Use this path after to run the program.
    9.         End If
    10.     End Sub
     
    singapore likes this.

Share This Page