search
尋找貓咪~QQ 地點 桃園市桃園區 Taoyuan , Taoyuan

C# Thread+GIF+Dialog 實作等待動畫 – jashliao部落格

C# Thread+GIF+Dialog 實作等待動畫

 

 

GITHUB URL : https://github.com/jash-git/CS_Animation_Thread

 

    public void createThreadAnimation(String StrMsg, ParameterizedThreadStart fun)//執行多執行序和顯示等待動畫
    {
        ProgressDialog d = new ProgressDialog();
        Thread t = new Thread(fun);
        t.Start(d);
        d.StartPosition = FormStartPosition.CenterParent;
        d.m_strMessage = StrMsg;
        d.ShowDialog();
    }

    public void Thread_function(object arg)//執行序
    {
        ProgressDialog d = (ProgressDialog)arg;
        ….do something….
        d.Invoke(new Action(d.Close));
    }

    ————
    
    createThreadAnimation(“Dialog Message”, Thread_function);
    
    
    //ps ProgressDialog包含一個GIF動畫和一個文字標籤

 

 

 



熱門推薦

本文由 jashliaoeuwordpress 提供 原文連結

寵物協尋 相信 終究能找到回家的路
寫了7763篇文章,獲得2次喜歡
留言回覆
回覆
精彩推薦