.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

how to shutdown a child window

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :WPF

dear everyone

i need to load many windows from parent window.

because i want to modify one of child windows, i don't want to shutdown all of program, just shutdown a child window of all windows what i want to modify , then load again.

i have lanuched the child window like below

 public void CreateSimPleWindow(string name)
            Thread newWindowThread = new Thread(new ThreadStart(CreateWindow));
            newWindowThread.IsBackground = true;

 public void CreateWindow()// Create new window
            MainWindow mainWindow = new MainWindow();



public void ExitWindow()//Shutdown window ,


 this.Dispatcher.InvokeShutdown();// i think this isn't real shutdown,but disappear the child window on screen look like shu

View Complete Post

More Related Resource Links

way of calling "javascript function of parent window from child window."

The article way of calling "javascript function of parent window from child window." was added by raja.s on Sunday, June 06, 2010.

Hi,Here i am going to explain how to call the javascript function of a parent window from the child window(pop-Up).Some may know before reading this post.Parent Java Script Function:script language="Javascript" type="text/javascript">

Timeout child window problem

The users of our site have reported a problem where when you have a child window open and click around in the main window, the child window will time out even though there is activity in the main window. We use an encryptedFormsAuthenticationTicket and http cookie that expires after a timeout period using Response.Cookies.Add(authCookie). Is there an obvious problem from this description? We are using the back button prevention like so:   Response.AppendHeader("Cache-Control", "no-cache") Response.AppendHeader("Cache-Control", "private") Response.AppendHeader("Cache-Control", "no-store") Response.AppendHeader("Cache-Control", "must-revalidate") Response.AppendHeader("Cache-Control", "max-stale=0") Response.AppendHeader("Cache-Control", "post-check=0") Response.AppendHeader("Cache-Control", "pre-check=0") Response.AppendHeader("Pragma", "no-cache") Response.AppendHeader("Keep-Alive", "timeout=3, max=993") Response.AppendHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT")  Could this cause timeout problems in child windows? Any suggestions?

Call parent window Page_Load when child closes

 I have a popup window that I open using  window.showModalDialog('Popup.aspx'); The client enters some information and then clicks a 'Save' button on the Popup window.  At that point I want the popup window to close and refresh the parent window which I though would execute the page_load event on the parent window. Here is the code that I have for the button click on the popup window. window.returnValue = true; window.close(); The popup window closes and it seems like the parent refreshes, but the page_load event on the parent is not called.  I put in a breakpoint to verify.  I need the page_load event to execute.   Thanks in advance for your help, JZ

I want to open a web page (.aspx page,child window from parent window) without titlebar how can we d


Hi All,

i have some special requirement like , i want to open a web page (child page) without a title bar for this i am following the below approach but it is not working, to open child window from parent window i am calling this javascript function to the of href of anchor tag...

function OpenChildWindow()

but the child window is opened with titlebar, but i don`t want any titlebar.

the titlebar property i was used in the above method is not working why?

how can we do this, can anybody help me...


Burepalli V S Rao.

Problem on opening child window on third time



I have a button that having an attributes as follow:

btnAddColumn.Attributes.Add("onClick", "selectDetailColumn('Type1',1); return false");

It will open a child window with the following assignment.

<script language="javascript" type="text/javascript">

        function selectDetailColumn(area, testType) {
            scLeft = (window.screen.availWidth - 600) / 2;
            scTop = (window.screen.availheight - 700) / 2;
            window.open('Details.aspx?, 'PopUp', 'width=600,height=700,top=' + scTop + ',left=' + scLeft + ',toolbars=no,scrollbars=no,status=no,resizable=no');

On this details.aspx, I have button to close the form as below:

<asp:Button ID="btnClose" runat="server" Width="80" Text="Close" OnClientClick="window.close();" />

What I did is when I open the child window, I will click on the Close button. I will repeat this process again. And on the third time I open the child window again, it wont open it, but instead the page "stays loading...".

Seems like the IIS is not responding.

i want to disable the entire parent window when the child window is opened?



 i am using the master page from the master page i am opening the child window.so, when ever i opened the child window i want to disable the entire parent window(all the controls present in the parent page) .how can we do it.


Burepalli V S Rao.

Creating a Child Window in WPF GRID



I'm using a grid that has a WindowsFormHost element in it and in the WindowsFormHost I have a win32 ActiveX control running this is working fine. I would like to place a set of WPF controls over the ActiveX object, I understand that the ActiveX object will always be the top most item so in order to place my controls on top I will need to create a separate window and put the controls in to it. I have looked at using a popup but would have to write extra code to get it to follow the main window if it's position changes and also size. What I'd like to do is create a new window and make it a child of the Grid to display the controls in. My questions are:

1) Can I attach the window as a child of the grid?

2) Would I need to change the zorder of the child window to ensure it was above the activex control?

3) Example code if possible would help.



How to make a wpf child window follow it's parent




I've been trying to make a child window follow it's parent, I've bound the child's Top and Left properties to it's parent and that works for resizing of the parent and when the parent is dragged around the screen.  However I've hit a problem when I maximize and minimize the parent the child doesn't match it's size. I've watched the values of the parents Top and left in the debugger and it seems to get set twice once with a value that matches the new size and again with it's previous value and I guess this is whats making the child window appear incorrectly. I'm starting to think that just binding to the parents Top and Left properties isn't going to work. Is there a better approach to achieve this?



stop flickering when form child appear like normal window



I have created an application with a mdiParent and some mdichilds that when are opened they the forms are set like normal window and FormBorderStyle has value 'None'. When I call any child that is set like this, the application seems to flicker (it seems that for a very short time the child appear like a normal window wit the title bar and minimize, maximize and close button) and very quick it's ok (the title bar is disapear and the child take his place on the mdiParent). But I want to stop this flickering it is very annoying.

Can somebody tell me how can I do that? I mention that I have created this application in dot.net

Thank you in advance

window.open a page from a child window



I want to ask how can i open a window from a child window....

I have a .ascx page when i click on a button i use javascript to window.open a .aspx page on this new page i want to have another button that opens another .aspx page using javascript window.open.

The problem is that window.open does not work the second time

Is there a limitation on the number of windows i can open?

How can i get the functionality that i mentioned above


Parent and child window acess elements


If I have Parent page A.aspx and I open a child window using javascript. Then how can i acess the elements say

textbox in child window from parent page. Also how can I acess a textbox in parent page from child page. Thanks

Child window getting minimized when i click on parent window using window.open



we are opening window.open pop-up as child-window from parent window. When i click on parent window then child window is getting minimized.

Is there any solution for making child-window not to be minimized when i click on parent window.

And child-window should not have minimize and maximized buttons. It should only have close button.(ie., I should be similar as ShowModalDialog ie., look and feel and functionality also).

Need a Child Window


There are only 2 kinds of windows in WPF from what I can tell. A Modal and Window. I need a Child window. One that stays on top but allows you to interact with the window below.

Like a floating tool bar.

I tried




static extern IntPtr SetParent (IntPtr hWnd,

GridView Parent Child View with JQuery Effects

I was just checked how to add some more cool effects to the GridView control using JQuery. In this post I will display parent-child data in the GridView control with some help of the wonderful JQuery library.

Let's first populate the GridView control.

GridView control to show master-child or master-slave data, written in c#, asp.net

I previously made a master slave datagrid using Visual Studio 2003 .Net (original article) that would allow users to show data to clients using collapse and expand features. These features however did not carry over to gridview for many users. This tutorial will explaing how to create a collapsable/expandable gridview in frameworks 2.0 and higher

Modal popup window in ASP.Net

A Masked div or modal popup window is a child window created from the parent window which prevents the user from interacting with parent window before he returns to the parent application.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend