Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 31st, 2005, 11:45 AM
Registered User
 
Join Date: Mar 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Closing Child Window

Good Morning,

I'm having trouble closing a child window in my app. The form contains a close button and the following code is attached to it:

private void ncCloseButton_Click(object sender, System.EventArgs e)
{
  NewCustomer ncClose = new NewCustomer();
  ncClose.Close();
}

When I click the close button on the form, nothing happens. I want the other windows to stay open (this is a MDI app). Of course, I can click the 'x' in the right corner to close it, but how can I make the form to close programmatically?

Thanks in advance!

 
Old March 31st, 2005, 11:48 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india
Default

use Me.Close (VB.NET)

 
Old March 31st, 2005, 12:05 PM
Registered User
 
Join Date: Mar 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ah, ok.

So in C# that would be: this.Close()

Thanks ashu! It worked.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Close Child window automatically on closing parent vikas67k C# 1 August 26th, 2008 02:00 AM
Closing all child window when browser is closed h@ckerz ASP.NET 2.0 Professional 1 July 17th, 2008 01:04 AM
Closing parent window from child window arnabghosh Javascript How-To 1 December 26th, 2007 01:18 AM
problem with closing the child window swarnap Javascript How-To 4 November 16th, 2006 12:54 AM
closing mdi child forms kanoorani VB Databases Basics 1 May 31st, 2006 03:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.