Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » This.Close closing more than it should
Closed Thread
Old 08-11-2005, 12:30 AM   #1 (permalink)
 
Newb Techie

Join Date: Aug 2005

Posts: 1

bootn

Default This.Close closing more than it should

Hi guys, thanks in advance for any input

I am currently writing a C# program and I am having trouble (god knows why) with the this.close event. I have a primary form, then the user clicks search and it brings up a search pop-up form.

Once the search is complete the user can double click the result (in a listview) and it will copy the selected result into the text boxes in the form behind and close the pop-up. Now all of this works beautifully, however, when it goes to close it shuts the whole application down not just the pop-up.

This is also true for the "close" button. I used the this.close event on a button and it too closes the whole application.

Any help or ideas would be fantastic!

Thanks again
bootn is offline  
Old 08-11-2005, 10:07 AM   #2 (permalink)
 
Ultra Techie

Join Date: Sep 2003

Location: Bamberg, Germany

Posts: 549

Iron_Cross

Send a message via ICQ to Iron_Cross Send a message via MSN to Iron_Cross Send a message via Yahoo to Iron_Cross
Default

You only need to do this to close the pop up form:
Code:
// let's assumet he pop up form is called frmPop
frmPop.Close();
I'm assuming the problem you're having is you're calling the MainForm's closing event from the pop up form. You need to call the PopUp Form's closing event.
__________________

See today\'s Penny-Arcade!(May contain foul lanuage)
Pain is weakness leaving the body.

PM Me for my MSN
Iron_Cross is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On