Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21243

[RESOLVED] Unexpected Issue With setting cdlg Properties At Runtime

$
0
0
This was written by Mickeysoft and inserted into this form because I used a Wizard to create it. (Needed some pretty stuff.)

This line causes the problem. '.CancelError = False' See below for the explanation.

Code:

Private Sub mnuFileOpen_Click()

    Dim strFileName As String
   
    With frmMain.cdlgCommonDialog
        .DialogTitle = "Open"
        .CancelError = False
        'ToDo: set the flags and attributes of the common dialog control
        .Filter = "All Files (*.*)|*.*"
        .ShowOpen
        If Len(.FileName) = 0 Then
            MsgBox "No file selected. Please try again."
            Exit Sub
        End If
        strFileName = .FileName
    End With
   
'ToDo: add code to process the opened file

End Sub

This is the code that let me know there was a problem.

Code:

Private Sub Form_Load()
 
    frmAbout.Show vbModal, Me

End Sub

What's happening is that execution hits
Code:

.CancelError = False
and jumps directly to the Form Load procedure, which shows the frmAbout screen again. (Luckily I put that on a 7 second timer.)

My main issue is why does execution make that jump? I suppose I can work around it if I must, but what a pain. I never expect much in the way of rational behaviour from Mickeysoft products, but this just doesn't make any sense.

Also, my impression of Wizards took a severe beating today when I created this form. It took me several hours to make it fit any kind of standards at all.

And "Yes" I downloaded both Python and Ruby and found out that the ***X community is still stuck where they were 10 years ago. Their software is a lot more flexible than Mickeysoft stuff, but they are still releasing products with no documentation and no file extensions, to be run on Windoze systems.

Viewing all articles
Browse latest Browse all 21243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>