-
December 10th, 2008, 06:43 PM
#1
[RESOLVED] Forms and Close() method
Hi all!!
I am developing a Windows based application using VS 2005.
I have a main form with a main menu on it and I use the menu items to call other forms of the application. When one of the menu items is clicked a form (which I call Form1) is called using the ShowDialog method. Then on this form there is a button that when clicked calls another form using ShowDialog again (called Form2). Form2 has a button that when clicked I call the Close() method to close the form. This way Form2 is closed but at the same time Form1 is closed too and I can not understand why. And I don't want this to happen. After displaying some info on Form2 I want to continue using Form1.
Any idea?? Please help ASAP....
-
December 10th, 2008, 07:04 PM
#2
Re: Forms and Close() method
I was unable to reproduce the described behaviour. Maybe you could post a small project showing the problem?
- petter
-
December 10th, 2008, 07:11 PM
#3
Re: Forms and Close() method
I cannot see why this would happen but...
One thing, rather than calling Form.Close() would be to assign the Forms 'CancelButton' property (in the designer) to the [Close] button and see if this cures your problem.
Rob
-
Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......
-
December 10th, 2008, 07:30 PM
#4
Re: Forms and Close() method
Show us the code. You are doing something to cause it, but we can't know what that is.
-
December 10th, 2008, 07:56 PM
#5
Re: Forms and Close() method
Originally Posted by BigEd781
Show us the code.
Show me the money!!!
Heh, yep, it's not possible to do this unless you have a mistake in your coding. Close() does not effect Owners.
Three5Eight
Using: MS C# 08 EE, MS SQL 05 EE, C++ .Net 08 EE, Vista Home Premium, XP Home
-
December 10th, 2008, 10:50 PM
#6
Re: Forms and Close() method
Thank you all for your time!!
I couldn't figure out what the problem was but after I tried some different things, I deleted the button that called Form2 on Form1 and recreated it and no problem remained))
Thank you again!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|