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 8644067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:12:19+00:00 2026-06-12T12:12:19+00:00

First I want to explain what I’m going to do: I’m developing a Learning

  • 0

First I want to explain what I’m going to do: I’m developing a Learning application to show some cards to the students. I have CardPack class that is a group of cards.

For licensing the card packs I want to get an ID from user then I’ve created a windows to get RegisterKey from user. this is my GetRegisterKey("CardPackName") method:

    public static string GetRegisterKey(string name)
    {
        GetRegisterKey grk = new GetRegisterKey(name);
        grk.ShowDialog();
        return grk.Key;
    }

but after grk.ShowDialog(); runs the program going to exit and I don’t know why! Can anybody help me to resolve this problem?!?


Update

I tried to create a new instance of GetRegisterKey in Windows_loaded event of MainWindows and I called grk.ShowDialog() and it worked fine and the program didn’t close. I don’t know what’s the source of my problem!

But I found out that the problem isn’t from GetRegisterKey then I’ll remove it’s code from the question.

Update2

I put a break point in return grk.Key; line to check if it runs but it didn’t run and the program closed!

  • 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-12T12:12:20+00:00Added an answer on June 12, 2026 at 12:12 pm

    See Application.ShutDownMode,

    http://msdn.microsoft.com/en-us/library/system.windows.application.shutdownmode.aspx

    Applications stop running only when the Shutdown method of the Application is called. Shut down can occur implicitly or explicitly, as specified by the value of the ShutdownMode property.

    If you set ShutdownMode to OnLastWindowClose, Windows Presentation Foundation (WPF) implicitly calls Shutdown when the last window in an application closes, even if any currently instantiated windows are set as the main window (see MainWindow).

    A ShutdownMode of OnMainWindowClose causes Windows Presentation Foundation (WPF) to implicitly call Shutdown when the MainWindow closes, even if other windows are currently open.

    The lifetime of some applications may not be dependent on when the main window or last window is closed, or may not be dependent on windows at all. For these scenarios you need to set the ShutdownMode property to OnExplicitShutdown, which requires an explicit Shutdown method call to stop the application. Otherwise, the application continues running in the background.

    ShutdownMode can be configured declaratively from XAML or programmatically from code.

    This property is available only from the thread that created the Application object.

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

Sidebar

Related Questions

first I'm gonna try to explain what exactly I want to do: I have
First i want to explain what i have done with my oracle, i use
First I'll explain what exactly I want to do here. I have a dialog
First thing i want to say that it's not an easy question to explain,
First I will try to explain what I want to do. The app loads
I have an object which I first want to rotate (about its own center)
First I want to describe my situation briefly. I have two classes, one MainClass
I have a problem but first i want to know if im working on
First i want to thanks you for watching my post! I have used django
First I would like to explain why I want to use alternate Blackberry Persistance

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.