You must Sign In to post a response.
  • Category: Windows

    How to close the application using button c# windows mobile?

    Hi members,

    I am learning windows mobile application using two buttons button1 message box another button closing the application how to use please guide me.

    here is the coding

    private void button1_Click(object sender, RoutedEventArgs e)
    MessageBox.Show("Lumia 800");

    private void button2_Click(object sender, RoutedEventArgs e)


  • #763197
    There are different ways of application exit, better to use Application.Terminate() method, according to MSDN "The Terminate method does not raise any application lifecycle events. Before you call this method, you must save the state of the app."
    read more about closing methods here

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #763198

    You can use Application.Current.Terminate() method.

    Example :
    private void Exit_Tap(object sender, System.Windows.Input.GestureEventArgs e)

    You can go through the below link of MSDN Code Library for more reference :

    Hope this will help you.

    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • Sign In to post your comments