Forms Frustration

MTSkull

Well-known member
Joined
Mar 25, 2003
Messages
135
Location
Boulder, Colorado
On the start up procedure for my application I have created 2 custom message box style forms.

One is a dialog form that pops up (using show()) displays status (no Buttons) then goes away. All controlled through code.

Two is a message box style form that has buttons and messages It pops up as a modal (showdialog()).

The error comes in my start up. I call the dialog window and start displaying messages "Connecting to Server" then I start my ado connection which I put in wrong to test the error handler, which writes to a log file then calls the procedure to display the second message box. This where the error is occuring. When I call the formModal.ShowDialog() the form Pops up for a second then disappears again. If I break on the following statment then move then execution line back to the showDialog statment it works the second time it runs. All the other forms I open with show dialog work fine.

Code:
    opens form as modal then passes back which button the user selected
    Public Function funShowMessageBox _
    (ByVal strMessage As String, ByVal strTitle As String, Optional ByVal iButtons As Int16 = 2) As Int16

        iButtons = 1 Go and Exit displayed
        iButtons = 2 OK displayed Default value

        Dim formModal As New frmMsgBox
        Dim TempMsg As String

        gstrMsgBoxMessage = strMessage
        gstrTitle = strTitle
        If iButtons > 2 Or iButtons < 1 Then
            giMsgBoxButtons = 2 Set to default in case invalid
        Else
            giMsgBoxButtons = iButtons
        End If

        formModal.ShowDialog()

        funShowMessageBox = giMsgBoxRtn

    End Function
 
Id have to see all of the code to know whats really going wrong. Can you post the code from Main (to see what the startup form is), the code in your main form that shows the non-modal popup, the function that makes the ADO connection and the parts that show the modal error dialog.

-Nerseus
 
There seemed to be a problem with just that form. I copied all the controls over to a new form deleted the bad one and renamed the new one to the bad one. Works like a champ now. Thanks for the help.
:)
 
Back
Top