![]()  | 
 
CommonDialog FilterShowSave | 
 
    Post Reply  
   | 
  
| Author | |
   
   Oleg  
   
   Senior Member  
   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: CommonDialog FilterShowSavePosted: 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  | 
 |
![]()  | 
 |
   
   McKloony  
   
   Senior Member  
   Joined: 09 January 2007 Location: Germany Status: Offline Points: 340  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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  | 
 |
![]()  | 
 |
    Post Reply  
   | 
  |
|       
  
  Tweet   	
    | 
 
| Forum Jump | Forum Permissions  ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum  |