|
-
Jun 17th, 2000, 04:07 AM
#1
Thread Starter
Lively Member
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]
-
Jun 17th, 2000, 04:15 AM
#2
Fanatic Member
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
-
Jun 17th, 2000, 04:23 AM
#3
Thread Starter
Lively Member
welll
I did that but I got an error.
Timbudtwo
I have no life, only one with computers.
VB 6.0 Enterprise Edition
[hr]
-
Jun 17th, 2000, 09:06 AM
#4
-
Jun 17th, 2000, 09:23 AM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|