Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8654485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:47:57+00:00 2026-06-12T14:47:57+00:00

i Have made a program in c# which show 2 types of form 1

  • 0

i Have made a program in c# which show 2 types of form 1 is getting values from the user and save it in Database and second is showing those values in a template of crystal report.

My problem is when i move 1st form to 2nd form i hide the first form by using hide(); function and after getting the value on 2nd form from Database i move back to 1st form and hide the second form and show 1st but when i close the whole program it keep running and debugger showing its and running and also have a process in task manager.

I want to know how can i close that background process with the form1 close. sorry for my bad English.

      rollno = txtrollno.Text;
                    ReportCard objreport = new ReportCard();
                    objreport.Show();
                    this.Hide();

this is the code for hiding the 1st form .

 Form1 objshow = new Form1();
        objshow.Show();
        this.Hide();

and in this i hide 2nd and show 1st again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:47:59+00:00Added an answer on June 12, 2026 at 2:47 pm

    Try using

    Close();
    

    When a form is closed, all resources created within the object are closed and the form is disposed. You can prevent the closing of a form at run time by handling the Closing event and setting the Cancel property of the CancelEventArgs passed as a parameter to your event handler. If the form you are closing is the startup form of your application, your application ends.

    or

    Application.Exit();
    

    This method stops all running message loops on all threads and closes all windows of the application. This method does not force the application to exit. The Exit method is typically called from within a message loop, and forces Run to return. To exit a message loop for the current thread only, call ExitThread .

    or

    Environment.Exit(exitCode)
    

    Terminates this process and gives the underlying operating system the specified exit code. This call requires that you have SecurityPermissionFlag.UnmanagedCode permissions. If you do not, a SecurityException error occurs. This is the call to use if you are running a console application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: Have made a small mail program which works perfectly on my developer pc
I have made a front end for a program which test java (foo.class) binary
I have made a registration program. Making use of mysql database. Can I still
I made small program, which you don't have to install. So when I want
I am making a project for college and have made a program which creates
I have made a program in Java which is used to collect medical data
I have made a program that scans rss feeds. This same program creates feeds
I have made my own file type (.ddd) and I made a simple program
I have a program made up of several .h and .c files and a
i have made a small opengl program using the d programming language. what i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.