Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[C#] Probleme mit ApplicationContext

Empfohlene Antworten

Veröffentlicht

Also ich habe jetzt zu Testzwecken ein Programm geschrieben in das ich eine neue Klasse eingefügt habe die so aussieht:

    class MyApp : ApplicationContext

    {

        public MyApp()

        {

            DoIt();

        }

        public void DoIt()

        {

            MessageBox.Show("Hallo Welt!");

            Application.Exit();


        }

    }
aufgerufen habe ich sie indem ich einfach den aufruf der Form1 Klasse durch meine ersetzt habe im Main.
        static void Main()

        {

            Application.EnableVisualStyles();

            Application.SetCompatibleTextRenderingDefault(false);

            Application.Run(new MyApp());

        }

Was muss ich jetzt noch machen damit sich das Programm auch wieder beendet?

Theoretisch sollte nach dem DoIt das Programm automatisch beendet werden.

Application.Exit();

braucht man da nicht, weil nach der MessageBox ist DoIt beendet, danach der Konstruktor beendet und dadurch die Run-Methode.

[Editerle]

Ok, ich sollte alles lesen.

http://msdn.microsoft.com/en-us/library/system.windows.forms.applicationcontext.exitthread.aspx

Bearbeitet von TDM

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.