Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

 

   '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

"Beer is proof that God loves us and wants us to be happy."

-Benjamin Franklin

  • *Experts*
Posted

I'd have to see all of the code to know what's 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

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

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.

:)

"Beer is proof that God loves us and wants us to be happy."

-Benjamin Franklin

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...