Save File screen?

Discussion in 'Visual Basic ( VB )' started by chico1st, Jul 12, 2007.

  1. chico1st

    chico1st New Member

    Joined:
    Jun 20, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    How do you get one of those screens to pop up which allows you to save a file and navigate around windows folders to do so.

    Also how to you get the open a file screen.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    You have OpenFileDialog and SaveFileDialog which help you doing that.
     
  3. chico1st

    chico1st New Member

    Joined:
    Jun 20, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    I cannot find any information about how to use this with my VisualBasic 6 (it has no help files), can someone please help.
    from what I understand OpenFileDialog returns the entire path of the location that you select.
    but my code doesnt seem to do anything.

    'This does nothing
    FName = OpenFileDialog

    'This gives me an error
    FName = OpenFileDialog()
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    I though you would be using the .NET but VB 6 there is a control for the same.
     
  5. munkyeetr

    munkyeetr New Member

    Joined:
    May 4, 2007
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Victoria BC, Canada
    Use the CommonDialog Control.
     
  6. chico1st

    chico1st New Member

    Joined:
    Jun 20, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    Ok when i click cancel in the open file dialogue i want to execute a command. But by using
    "on error goto cancel" the code in Cancel wont execute one i have executed the loaded a file once. in fact crazy things start to happen. is there any sort of "On cancel exit sub" or something, this is the outline of my code

    Private Sub cmdLoad_Click()

    On Error GoTo Cancel
    ...
    Exit Sub

    Cancel:
    ...
    Exit Sub

    End Sub

    thank you for your time
     
  7. chico1st

    chico1st New Member

    Joined:
    Jun 20, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    nevermind i needed to click the "cancel error" box in the properties of the dialogue box. Apparently without that it wont always give an error.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice