Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 19:22

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



WPA Animated Progress Bar

Discussion on WPA Animated Progress Bar within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 700
Join Date: Aug 2017
Posts: 174
Received Thanks: 24
WPA Animated Progress Bar

Hallöchen,

zur zeit versuche ich meine ProgressBar so zu gestallten, dass wenn der Value Wert 100 erreicht hat, dass der Splash Screen sich schließt und das Hauptmodul geladen wird. Aber ich scheitere an folgendem Problem (WPA war nie so wirklich meines)

Code:
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Animation;
using System.Windows.Threading;

namespace Cabal_EU_Online_Hack
{
    /// <summary>
    /// Interaktionslogik für Splash.xaml
    /// </summary>
    public partial class Splash : Window
    {
        DispatcherTimer timer = new DispatcherTimer();

        public Splash()
        {
            InitializeComponent();
            createtimer();
        }

        private void createtimer()
        {
            splashProgress.IsIndeterminate = false;

            Duration dur = new Duration(TimeSpan.FromSeconds(10));
            DoubleAnimation dba = new DoubleAnimation(200.0, dur);

            splashProgress.BeginAnimation(ProgressBar.ValueProperty, dba);

            if (splashProgress.Value == 100)
            {
                timer.Stop();
                MainWindow mw = new MainWindow();
                this.Hide();
                mw.Show();
            }
        }
        private void move(object sender, MouseButtonEventArgs e)
        {
            DragMove();
        }

        private void splashScreen_Loaded(object sender, RoutedEventArgs e)
        {
            timer.Start();
        }
    }
}
Die Animation erfolgt, aber es passiert nichts, da keine Value increased wird. Was kann ich nun anders machen, um eine Animation zu haben, aber auch einen unsichtbaren Value Wert?
Lucky_Patcher is offline  
Old 05/05/2018, 01:33   #2
Moderator


 
elite*gold: 558
Join Date: Feb 2010
Posts: 6,546
Received Thanks: 1,418
Also dein Problem ist da vor allem ein Denkfehler. Dein Programm wartet nach "BeginAnimation" nicht bis die Adnimation zu Ende ist, sondern läuft sofort weiter. Bei dem Durchlauf ist "Value" natürlich noch 0, danach wird die Methode nie wieder aufgerufen und damit auch der Vergleich nie wieder durchgeführt.

Für eine Lösung habe ich jetzt die Dokumentation gequält, da ich mit den Animationen auch noch nie gearbeitet habe.
Code:
        private void createtimer()
        {
            splashProgress.IsIndeterminate = false;

            Duration dur = new Duration(TimeSpan.FromSeconds(10));
            DoubleAnimation dba = new DoubleAnimation(200.0, dur);
            dba.Completed += () => {
                timer.Stop();
                MainWindow mw = new MainWindow();
                this.Hide();
                mw.Show();
            };

            splashProgress.BeginAnimation(ProgressBar.ValueProperty, dba);
        }
(Eventuell auch mit Tippfehlern, habe den Code hier im Browser geschrieben)


Den Timer verwendest du nicht, den kannst du eigentlich auch entfernen.
ComputerBaer is offline  
Thanks
1 User
Old 05/05/2018, 01:57   #3
 
elite*gold: 700
Join Date: Aug 2017
Posts: 174
Received Thanks: 24
Ich habe das ganze nun mal anders gemacht, mit meinem Timer, und nun funktioniert es perfekt

Code:
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Animation;
using System.Windows.Threading;

namespace Cabal_EU_Online_Hack
{
    /// <summary>
    /// Interaktionslogik für Splash.xaml
    /// </summary>
    public partial class Splash : Window
    {
        DispatcherTimer timer = new DispatcherTimer();
        
        public Splash()
        {
            InitializeComponent();

            timer.Tick += new EventHandler(timer_Tick);
            timer.Interval = new TimeSpan(0, 0, 1);
        }

        private void timer_Tick(object sender, EventArgs e)
        {
            splashProgress.IsIndeterminate = false;

            Duration dur = new Duration(TimeSpan.FromSeconds(10));
            DoubleAnimation dba = new DoubleAnimation(200.0, dur);

            splashProgress.BeginAnimation(ProgressBar.ValueProperty, dba);

            if (splashProgress.Value == 100)
            {
                timer.Stop();
                Login mw = new Login();
                this.Hide();
                mw.Show();
            }
        }

        private void move(object sender, MouseButtonEventArgs e)
        {
            DragMove();
        }

        private void splashScreen_Loaded(object sender, RoutedEventArgs e)
        {
            timer.Start();
        }
    }
}
Der Timer füllt den Status und sobald die Animation durch ist, wird in das andere Fenster gesprungen.

Lucky_Patcher is offline  
Reply


Similar Threads Similar Threads
[Selling] *50% OFF* Animated Avatar + Animated Signature 7eur PayPal (Done in less than 30min)
08/07/2014 - Artist Trading - 0 Replies
Hello ePvP! :) Offering you my discount pack Animated Avatar + Animated Signature Only 6.99eur PayPal The designs will be done in less than 30min Here are some of my jobs: http://i.epvpimg.com/IsE4e.gifhttp://i.epvpimg.co m/Qpefg.gifhttp://i.epvpimg.com/WSgsf.gifhttp://i. epvpimg.com/4XoYb.gifhttp://i.epvpimg.com/tPtUc.pn ghttp://i.epvpimg.com/XGfqe.gif http://i.epvpimg.com/E62Ke.gif
Anonymous GFX pack 2'ava's/2sig/animated banner/animated pushbutton/ ~150*g BUYNOW
10/28/2013 - elite*gold Trading - 4 Replies
ONLY 150*Gold! JUST PN! http://s1.directupload.net/images/131027/pxfv76l2 .png http://i.epvpimg.com/xlNgh.png http://i.epvpimg.com/YILPe.gif http://i.epvpimg.com/thSGd.gif
[Selling] Anonymous GFX pack 2'ava's/sig/animated banner/animated pushbutton/sig ~200e*g BUYNOW
10/26/2013 - elite*gold Trading - 2 Replies
Pack = 200 e*g !!! 3 TREASURES ONLY! FAST FAST GET IT NOW ! # 2 Avatars http://i.epvpimg.com/N16Vd.png http://i.epvpimg.com/QMbld.png #Push button http://i.epvpimg.com/TmFqh.gif
Best time to activate premium ? Grey bar , yellow bar or red bar ?
06/14/2013 - Silkroad Online - 1 Replies
Im playing silkroad r . Im currectly level 86. What would be the best time to activate a premium plus ? During the yellow , red or grey bar ?



All times are GMT +1. The time now is 19:22.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.