yanmai
Goto Top

C-Sharp Event fängt an rumzuspinnen

Hallo ihr Administratoren,
ich möchte einen schönen Effekt von dem Metroframework einbinden, wenn die Maus über ein Steuerelement fährt. An sich funktioniert alles, aber wenn man den Zeiger schneller als die Effektdauer wieder auf das Element macht, stürzt das Programm ab. Hier ist mein Code:

bool b = true;
            if (b == true)
            {
                b = false;
                MetroFramework.Animation.ColorBlendAnimation c = new MetroFramework.Animation.ColorBlendAnimation();
                c.Start(this.panel3, "BackColor", Color.Silver, 5);  
                c.AnimationCompleted += (sender2, e2) =>
                { b = true; };
                this.label1.Text = "Öffnen Sie einen Webbrowser";  
                MetroFramework.Animation.ColorBlendAnimation c1 = new MetroFramework.Animation.ColorBlendAnimation();
                c1.Start(this.label1, "ForeColor", Color.Silver, 5);  
                c1.AnimationCompleted += (sender1, e1) =>
                { b = true; };
            }

Aber auch das funktioniert nicht. Wie behebe ich diesen Fehler?

Content-Key: 335592

Url: https://administrator.de/contentid/335592

Printed on: April 24, 2024 at 22:04 o'clock

Member: SlainteMhath
SlainteMhath Apr 20, 2017 at 14:46:55 (UTC)
Goto Top
Moin,

Also
bool b = true;
            if (b == true)
            {
ist ja schon ziemlich sinnfrei...

Wie behebe ich diesen Fehler?
Try ... catch?


lg,
Slainte
Member: Yanmai
Yanmai Apr 20, 2017 at 16:34:55 (UTC)
Goto Top
Das Problem ist, das Programm stürzt an dieser Stelle ab:

Application.Run(new Form1());