Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a splash screen that it's my startup form.

 

Code :

 

Dim frm1 As New frmMain()

frm1.Show()

me.close()

 

In the frm1 when I click Close button i put:

 

Me.Close()

 

I error... anyone can tell me what should I do to close a form without having error please

Posted

I have this message:

 

Object reference not set to an instance of an object

IF i do :

 

Try

EnregistrerNote()

Catch e As Exception

MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)

 

End Try

Posted

Create a module with the Sub Main in it.

 

See this code:

 

Module mMain

   Public fSplash As frmSplash
   Public fMain As frmMain

   Public Sub Main()

       fSplash = New frmSplash
       fSplash.Show()

       Application.Run(New frmMain)

   End Sub

End Module

 

Now with this you can call the close method of the fSpalsh whenever you want on the fMain code... On the end of the fill of a DataSet for example! :D

Software bugs are impossible to detect by anybody except the end user.
Posted

The VolteFace cade works perfectly but since I discovered this way I have I don't use another. Just because, sometimes, I need to leave the splash screen visible, topmost, with the MainForm already shown.

The example I can give you is when the user has to register the product before continuing...

Or other example is the leading bunrning software NERO. the splash stays longer than the load of the form...:D

 

Your way is easyer... no doubt :eek:

Software bugs are impossible to detect by anybody except the end user.
  • *Experts*
Posted

Well, you don't *have* to close the splash screen in the Form_Load event. You can take out the splash.Close() line and it will remain, so then you can close it however else you like.

 

The only reason I would recommend my way is because it allows you to actually initialize the form (which is what splash screens are for), while many of the other ways don't even load the form until the splash screen closes, so no real initializing happens, defeating the point of a splash screen. It's all a matter of preference. :)

Posted

Ok... no more struggle... ;)

 

You keep yours, I keep mine...

They do quite the same thing !! ehehe

 

:D I like talking with some good coders... Good forum... :D

Software bugs are impossible to detect by anybody except the end user.

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...