Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi,

I am making an application in WPF, which consists of Window and a login UserControl
That user control is added as a child in MainWindow at runtime, now when i click login button of usercontrol it gets logged in and loads a new window. But i want to close the login UserControl alone not the parent window.

i have tried this code

Window parentWindow = Window.GetWindow(this);
parentWindow.Close();

but it closes the parent window not the user control.
Please help me in this!!

Thanks Regards,
Sankar
Posted
Comments
Sergey Alexandrovich Kryukov 17-Sep-14 9:59am    
What would this "closing" supposed to do? :-)
—SA

1 solution

 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900