Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

How do I control what happens when a form is closed? I know in VB6 it was through the unload event, but how do I code this in VB.NET? Which event do I refer to?

 

Also, I have a splash screen, and after it is done, I hide it. After I close another form which it opened, my application does not terminate fully. I suspect this is due to the "Hide" operation I called. Is there anyway to come around this problem?

Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Posted

1. Hiding it will keep the object alive. You could set it to nothing and eventually let the garbage collector get rid of it.

 

2. You now have the event "Closing"

.nerd
Posted

Actually you have 2 events now, depending on what you want to do, closing is like the unload in VB6 and closed that happens after the closing event.

See which one helps you out

Fat kids are harder to kidnap
Posted
ok, thanx, i'm leaving for home now, will take a look at it later on, thanx...
Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Posted

er........somnehow when i use me.close

my hold program closes

 

my code sequence is like this :

 

form2.show()

me.close()

 

is the sequence of code correct? coz i want form2 to appear then close the current form...

Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Posted

Hi,

 

What i would do is set form2 as the startup form then in its on_load function type something like;

 

on_load() etc...

 

me.hide

splash.show

splash.repaint

 

then add a timer to your splash form so that after say 5 seconds it does something like this;

 

frmstartup.show

splash.close

me.repaint

Posted

okay, which means i am actually opening other forms first...hm......okok, will try that

 

also, in VB6, i have a way of disabling people from entering text into a textbox when they tried to key it in by setting KeyAscii = 0 under the keypress event, but in VB.NET, the keypress event does not have this, i have tried the e.empty event but doesn't seem to work, is that the right one? or is there another way to do so ? i want to do this without having to disable the text box as this will darken the textbox, i don't want that...

Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Posted

er........may i ask? wat is the .repaint for?

 

also, is this the only way to solve the problem about the splashscreen ending the whole program?

 

wat if i'm facing this problem not at the startup? don't tell me i will have to open all forms in advance and just hide them b4 i use them?

Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...

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