Print Page | Close Window

CommonDialog FilterShowSave

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=10616
Printed Date: 30 April 2024 at 12:35am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CommonDialog FilterShowSave
Posted By: McKloony
Subject: CommonDialog FilterShowSave
Date Posted: 14 May 2008 at 1:59am
https://forum.codejock.com/uploads/20080514_015455_CodeJock_Dialog.zip - 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



Replies:
Posted By: Oleg
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net