-
Im using common dialog with this code,
and it doesnt work to when the cancel
button is pressed.
Code:
With frmPG.CommonDialog1
.fileName = sLastSave
.DialogTitle = "Save State"
.DefaultExt = ".pcs"
.Filter = "PicBot Saved State | *.pcs"
.ShowSave
If .fileName = "" Then Exit Sub
End With
How can I use this code and know when the cancel
button is pressed?
[Edited by Evan on 11-26-2000 at 12:52 PM]
-
Code:
If frmPG.CommonDialog1.Filename <> 0
'the user did not press cancel
End If
-
<?>
Code:
Private Sub Command1_Click()
On Error GoTo GetOut:
With frmPg.CommonDialog1
.CancelError = True 'used in cancel code
.FileName = sLastSave
.DialogTitle = "Save State"
.DefaultExt = ".pcs"
.Filter = "PicBot Saved State | *.pcs"
.ShowSave
If .FileName = "" Then Exit Sub
End With
Exit Sub
GetOut:
Exit Sub 'error 32775 genterated by .CancelError = true
End Sub
-
Or you can use:
Code:
If Err <> 32755 Then
'Cancel was not pressed
End If