Results 1 to 5 of 5

Thread: More help...:confused:

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    Ca
    Posts
    93
    Ok, i'm making a program for a super realistic game called Tribes. I am just making a text box and a button called save. I wanted to know how I can get that button to make a save box come up to ask where you want to save it. I also want to know how I can specify what I want it to save by as a deafult in that little dropdown box. I it will have in the save as file box it will have a .cs file option and an all types option.
    How would I be able to do that? What would be the code. I'm 11 so go easy on me.
    Timbudtwo
    I have no life, only one with computers.

    VB 6.0 Enterprise Edition
    [hr]

  2. #2
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655

    Wink

    Use the common dialog control...

    Code:
    Private Sub Command1_Click()
    commondialog1.showsave
    End Sub
    Then simply add a filter to get the file types you'd like in it.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    Ca
    Posts
    93

    Unhappy welll

    I did that but I got an error.
    Timbudtwo
    I have no life, only one with computers.

    VB 6.0 Enterprise Edition
    [hr]

  4. #4
    Guest
    What does the Error say?

  5. #5
    Guest
    Did you put the CommonDialog on your form?
    If you've done that, use this code:

    Code:
    Private Sub Command2_Click() 
    'display the commondialog show save
    On Error GoTo QuitNow: 
    CommonDialog1.InitDir = "C:\" 'set dir path 
    CommonDialog1.CancelError = True 'used in cancel code 
    CommonDialog1.Filter = "All files(*.*)|*.*" 'filter for all files 
    'use CommonDialog1.Flags = flag1 (or multi flag - flag1 + flag2) if you want
    CommonDialog1.ShowSave 
    'show files 
    QuitNow: 
    Exit Sub 
    End Sub 
    
    Private Sub Command1_Click() 
    'display the commondialog show open
    On Error GoTo QuitNow: 
    CommonDialog1.InitDir = "C:\" 'set dir path 
    CommonDialog1.CancelError = True 'used in cancel code 
    CommonDialog1.Filter = "All files(*.*)|*.*" 'filter for all files 
    'use CommonDialog1.Flags = flag1 (or multi flag - flag1 + flag2) if you want
    CommonDialog1.ShowOpen 
    'show files 
    QuitNow: 
    Exit Sub 
    End Sub
    Need more help? Search "CommonDialog constants" in VB's help file.

    Hope that helps.


Posting Permissions

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



Click Here to Expand Forum to Full Width