fkheng Posted June 5, 2003 Posted June 5, 2003 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? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
zy_abc Posted June 5, 2003 Posted June 5, 2003 If you want to close any form use Me.Close() Hope it helps Quote Thanks & Regards, zy_abc
Heiko Posted June 5, 2003 Posted June 5, 2003 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" Quote .nerd
iebidan Posted June 5, 2003 Posted June 5, 2003 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 Quote Fat kids are harder to kidnap
fkheng Posted June 5, 2003 Author Posted June 5, 2003 ok, thanx, i'm leaving for home now, will take a look at it later on, thanx... Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
fkheng Posted June 12, 2003 Author Posted June 12, 2003 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... Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Abaillie Posted June 12, 2003 Posted June 12, 2003 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 Quote
fkheng Posted June 12, 2003 Author Posted June 12, 2003 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... Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Administrators PlausiblyDamp Posted June 12, 2003 Administrators Posted June 12, 2003 IIRC you need to set e.handled = true Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
fkheng Posted June 12, 2003 Author Posted June 12, 2003 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? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
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.