Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - CommonDialog FilterShowSave
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CommonDialog FilterShowSave

 Post Reply Post Reply
Author
Message
McKloony View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 January 2007
Location: Germany
Status: Offline
Points: 340
Post Options Post Options   Thanks (0) Thanks(0)   Quote McKloony Quote  Post ReplyReply Direct Link To This Post Topic: CommonDialog FilterShowSave
    Posted: 14 May 2008 at 1:59am
uploads/20080514_015455_CodeJock_Dialog.zip
 
How can i find out, if the user has pressed the Cancle Button of the ShowSave or ShgowOpen Dialog. If I check the FileTitle Porperty it only works teh first time of use.
 
1. Open the attached VB sample
2. Press the Form Button and then press the Save Button in the ShowSave dialog
3. Then Press the Form Button again and then press the Cancle Button in the ShowSave dialog.
4. You will see, that die FileTitle Dialog shows agaon the content of the saved file in step 2.
 
Product: Xtreme SuitePro (ActiveX) 16.2.5

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2008 at 7:23am
Hi,
 
we have to make it work same as standard CommonDialog form Microsoft.
 
Use CancelError property.
 
Private Sub PushButton1_Click()
 On Error GoTo ErrHandler
Dim FiNam As String
Set ComCom = Me.CommonDialog1
With ComCom
    .CancelError = True
 
    '.DialogStyle = 1
    .DefaultExt = "*.jpg"
    .Filter = "Joint Photographic Experts Group (.jpg)|*.jpg|Windows Bitmap (.bmp)|*.bmp|Graphics Interchange Format (.gif)|*.gif|Tagged Image Format (.tif)|*.tif|Windows Metafile (.wmf)|*.wmf"
    .DialogTitle = "Wo befindet sich die Grafikdatei?"
    .InitDir = "c:\"
    .FileName = "c:\Test.jpg"
'    .FileTitle = ""
    .ShowSave
    FiNam = .FileName
    If .FileTitle = "" Then Exit Sub
   
    MsgBox FiNam, vbInformation, .FileTitle
End With

ErrHandler:
  'User pressed the Cancel button
  Exit Sub
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.