MTSkull Posted June 4, 2003 Posted June 4, 2003 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 Quote "Beer is proof that God loves us and wants us to be happy." -Benjamin Franklin
*Experts* Nerseus Posted June 5, 2003 *Experts* Posted June 5, 2003 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 Quote "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
MTSkull Posted June 9, 2003 Author Posted June 9, 2003 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. :) Quote "Beer is proof that God loves us and wants us to be happy." -Benjamin Franklin
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.