Home
|
Tutorial
|
Articles
|
Forum
|
Interview Question
|
Code Snippets
|
News
|
Fun Zone
|
Poll
|
Web Links
|
Certification
|
Search
Welcome :
Guest
Sign In
Register
Win Surprise Gifts!!!
Congratulations!!!
Top 5 Contributors of the Month
G N
Akhil Raj
Dhananjay Kumar
laptop charles
Majith
Home
>>
Forum
>>
Windows Application
>>
Post New Question
Subscribe to Forum
Close others forms in windows application
Posted By :
Shweta
Posted Date :
06/05/2010
Points :
2
Category :
Windows Application
Hi,
how to close all the other windows form in windows application except the main form in button click event?
Responses
Author:
Lalit
Company URL:
http://www.dotnetspark.com
Posted Date: 06/05/2010 Points: 5
Hi,
Shweta Get here solution
http://devcity.net/articles/94/1/.aspx
Please Check my answer if you help....
Thank You...
Lalit.
Author:
Santosh
Company URL:
http://santoshdotnetarena.blogspot.com
Accepted Answer
Posted Date: 07/05/2010 Points: 10
Hi Shweta,
I don't know u r working in vb.net or c#.net.
any way my code is in vb.net,
try below code,i think u will get ur solution.
Code:
Private Sub CloseAllForms_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseAllForms.Click
If (My.Application.OpenForms.Count - 1) > 0 Then
For i As Integer = 0 To My.Application.OpenForms.Count - 2
If My.Application.OpenForms.Count > 1 Then
My.Application.OpenForms.Item(My.Application.OpenForms.Count - 1).Close()
End If
Next
End If
End Sub
Any problem plz Reply......
Regards
Santosh
Author:
Shweta
Company URL:
http://www.dotnetspark.com
Posted Date: 10/05/2010 Points: 5
Thanks Santosh..Its working..
Regards,
Shweta
Post Reply
You must
Sign In
To post reply
Related Questions Related Questions
How to close my C# + Windows application safely...
C#.NET - Sample N Tier Windows Forms Application
How to create a control in windows application also how could add in the Tool box itself
Windows application Form Focus in C#.NET
Difference Between console application and windows application?
Latest Forum Questions From The Same Category
how to send sms from Windows Application usnig C#
how can i checked if form is already open in c#
How to disassemble exe file?
Combo Box with suggestion list using C#
how to save file in Multipal Extenstion using c#
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Here
Quick Links For Forum Categories:
ASP.Net
Windows Application
.NET Framework
C#
VB.Net
ADO.Net
Sql Server
SharePoint
OOPs
Silverlight
IIS
JQuery
JavaScript/VBScript
Biztalk
WPF
Patten/Practices
WCF
Others
www.DotNetSpark.com
UnAnswered
All
Hall of Fame
Twitter
Terms of Service
Privacy Policy
Contact Us
Archives
Tell A Friend