Valhalla Legends Archive

Programming => General Programming => .NET Platform => Topic started by: Antichrist on August 26, 2004, 07:26 PM

Title: VB: Close, not Exit!! (Solved)
Post by: Antichrist on August 26, 2004, 07:26 PM
Now that my menu/opening another window problem is solved.. I just realized I need to make the code for the "Cancel" button for such windows as the Userlist and Configuration windows. Hm.. I had some code that I tried that had no effect, yet it had no errors in it, I must of deleted it because I can't find it. The code probably was actual code, just didn't do what I thought it would do. What I want it to do is just close that ONE window. I thought 'End' would work, but I was wrong because that closed the entire bot.. Lol.

Thanks.

Title: Re:VB: Close, not Exit!!
Post by: hismajesty on August 26, 2004, 08:04 PM
Me.Close
Title: Re:VB: Close, not Exit!!
Post by: Banana fanna fo fanna on August 27, 2004, 07:51 AM
me.hide
me.visible = false
Title: Re:VB: Close, not Exit!! (Solved)
Post by: Antichrist on August 30, 2004, 03:40 PM
Thanks hismajesty, I used your code:


Me.Close


I'm sure your code would have done the same $torm, but Me.Close is one line :-P not two. :-D So I thank you aswell... and who knows, your code might help for something else I do.
Title: Re:VB: Close, not Exit!! (Solved)
Post by: MyndFyre on August 30, 2004, 06:01 PM
Quote from: Antichrist on August 30, 2004, 03:40 PM
Thanks hismajesty, I used your code:


Me.Close


I'm sure your code would have done the same $torm, but Me.Close is one line :-P not two. :-D So I thank you aswell... and who knows, your code might help for something else I do.

No, $t0rm's code would not have done the same thing.  Me.Close() disposes the object so you can't access it again through the same instance reference, whereas Me.Hide() --OR-- Me.Visible = false (they are TWO one-line examples of the SAME thing) just makes the window invisible, but you can still access it through the same instance reference.
Title: Re:VB: Close, not Exit!! (Solved)
Post by: hismajesty on August 30, 2004, 06:02 PM
He asked to close it - not hide it, though. :P
Title: Re:VB: Close, not Exit!! (Solved)
Post by: MyndFyre on August 30, 2004, 06:05 PM
Quote from: hismajesty[yL] on August 30, 2004, 06:02 PM
He asked to close it - not hide it, though. :P

Well then $t0rm's methods wouldn't have worked.  I was illustrating the difference between what YOU said and what $t0rm said.
Title: Re:VB: Close, not Exit!! (Solved)
Post by: hismajesty on August 30, 2004, 06:06 PM
Quote from: MyndFyre on August 30, 2004, 06:05 PM
Quote from: hismajesty[yL] on August 30, 2004, 06:02 PM
He asked to close it - not hide it, though. :P

Well then $t0rm's methods wouldn't have worked.  I was illustrating the difference between what YOU said and what $t0rm said.

I know!
Title: Re:VB: Close, not Exit!! (Solved)
Post by: Antichrist on August 31, 2004, 07:18 PM
Ah, and I didn't even catch that, I may need more knowledge than I thought. Hiding it would cause a problem I image, because would it not still be running even though you click the button..
Title: Re:VB: Close, not Exit!! (Solved)
Post by: hismajesty on August 31, 2004, 08:14 PM
Hiding it just means it isn't visible. For what you need, use the code I posted.