做爰高潮a片〈毛片〉,尤物av天堂一区二区在线观看,一本久久A久久精品VR综合,添女人荫蒂全部过程av

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當(dāng)前位置: 首頁 - 科技 - 知識百科 - 正文

仿vs實現(xiàn)WPF好看的進(jìn)度條

來源:懂視網(wǎng) 責(zé)編:小采 時間:2020-11-27 22:38:30
文檔

仿vs實現(xiàn)WPF好看的進(jìn)度條

仿vs實現(xiàn)WPF好看的進(jìn)度條:為了界面友好,一般的操作時間較長時,都需要增加進(jìn)度條提示。由于WPF自帶的進(jìn)度條其實不怎么好看,而且沒啥視覺效果。后來,裝VS2012時,發(fā)現(xiàn)安裝過程中進(jìn)度條效果不錯,于是上網(wǎng)查了資料。學(xué)習(xí)了ModernUI(開源的),地址:https://github.com/
推薦度:
導(dǎo)讀仿vs實現(xiàn)WPF好看的進(jìn)度條:為了界面友好,一般的操作時間較長時,都需要增加進(jìn)度條提示。由于WPF自帶的進(jìn)度條其實不怎么好看,而且沒啥視覺效果。后來,裝VS2012時,發(fā)現(xiàn)安裝過程中進(jìn)度條效果不錯,于是上網(wǎng)查了資料。學(xué)習(xí)了ModernUI(開源的),地址:https://github.com/

為了界面友好,一般的操作時間較長時,都需要增加進(jìn)度條提示。由于WPF自帶的進(jìn)度條其實不怎么好看,而且沒啥視覺效果。后來,裝VS2012時,發(fā)現(xiàn)安裝過程中進(jìn)度條效果不錯,于是上網(wǎng)查了資料。學(xué)習(xí)了ModernUI(開源的),地址:https://github.com/firstfloorsoftware/mui。

  后來,做了嘗試寫了個Demo,效果不錯。另外,專門錄制了tif文件,方便大家看到效果。廢話不多說,先展示效果:

一、效果展示

  A、VS2012安裝界面圖;

  B、個人嘗試Demo效果圖: 

二、實現(xiàn)說明

  1、下載MUI相關(guān)代碼或者dll文件;

  2、工程中引入該dll,并引入其資源文件;

代碼如下:
<Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/FirstFloor.ModernUI;component/Assets/ModernUI.xaml" />
                <ResourceDictionary Source="/FirstFloor.ModernUI;component/Assets/ModernUI.Light.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>

  3、在需要顯示進(jìn)度條的頁面,加入控件(其實還是WPF控件,只是MUI擴(kuò)展了其樣式而已);

代碼如下:
<Label Margin="280,169,0,0" Style="{StaticResource BackGroundContentText}" x:Name="lblMainState" HorizontalAlignment="Left" VerticalAlignment="Top">正在啟動:</Label>
        <ProgressBar Margin="280,200,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="500" Minimum="0" x:Name="ProgressControlRealValue" Maximum="1"  Value="0.1" Height="16" IsIndeterminate="False"/>
        <Label Margin="280,212,0,0" Style="{StaticResource BackGroundContentText}" x:Name="lblProcess" HorizontalAlignment="Left" VerticalAlignment="Top">正在加載地圖數(shù)據(jù)...</Label>
        <ProgressBar Margin="280,250,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"  Minimum="0" x:Name="ProgressControl"  Width="500" Maximum="2" Height="16" IsIndeterminate="True" />

  4、后臺實現(xiàn),由于要根據(jù)情況更新進(jìn)度文字及進(jìn)度條的值。所以,這里用到了異步BackgroundWorker(具體可以網(wǎng)上查查相關(guān)資料);

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Monitor.Class
{
 /// <summary>
 /// 異步操作
 /// </summary>
 public class CWorker
 {
 /// <summary>
 /// 對象
 /// </summary>
 private BackgroundWorker backgroundWorker;

 /// <summary>
 /// 后臺執(zhí)行的操作
 /// </summary>
 public Action BackgroundWork { get; set; }

 /// <summary>
 /// 后臺任務(wù)執(zhí)行完畢后事件
 /// </summary>
 public event EventHandler<BackgroundWorkerEventArgs> BackgroundWorkerCompleted;

 private BackgroundWorkerEventArgs _eventArgs;//異常參數(shù)

 /// <summary>
 /// 構(gòu)造
 /// </summary>
 public CWorker()
 {
 _eventArgs = new BackgroundWorkerEventArgs();
 backgroundWorker = new BackgroundWorker();
 backgroundWorker.WorkerReportsProgress = true;
 backgroundWorker.WorkerSupportsCancellation = true;
 backgroundWorker.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
 backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
 }

 /// <summary>
 /// 開始工作
 /// </summary>
 public void BegionWork()
 {
 if (backgroundWorker.IsBusy)
 return;
 backgroundWorker.RunWorkerAsync();
 }

 /// <summary>
 /// 工作
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
 if (BackgroundWork != null)
 {
 try
 {
 BackgroundWork();
 }
 catch (Exception ex)
 {
 _eventArgs.BackGroundException = ex;
 }
 }
 }

 /// <summary>
 /// 完成
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
 if (this.BackgroundWorkerCompleted != null)
 {
 this.BackgroundWorkerCompleted(null, _eventArgs);
 }
 }
 }

 /// <summary>
 /// 事件
 /// </summary>
 public class BackgroundWorkerEventArgs : EventArgs
 {
 /// <summary>
 /// 后臺程序運行時拋出的異常
 /// </summary>
 public Exception BackGroundException { get; set; }
 }
}

namespace Monitor
{
 /// <summary>
 /// Splash.xaml 的交互邏輯
 /// </summary>
 public partial class Splash : Window
 {
 MainWindow m_MainWindow = null;//主窗口
 CWorker m_Work = null;//任務(wù)

 public Splash()
 {
 InitializeComponent();
 m_MainWindow = new MainWindow();//創(chuàng)建主窗口對象
 m_Work = new CWorker();
 m_Work.BackgroundWork = this.ProcessDo;
 m_Work.BackgroundWorkerCompleted += new EventHandler<BackgroundWorkerEventArgs>(m_Work_BackgroundWorkerCompleted);
 }

 /// <summary>
 /// 進(jìn)度提示
 /// </summary>
 public void ProcessDo()
 {
 m_MainWindow.InitData(this);
 }

 /// <summary>
 /// 移動
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
 this.DragMove();
 }

 /// <summary>
 /// 窗口加載
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
 m_Work.BegionWork();
 }

 /// <summary>
 /// 執(zhí)行完成
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void m_Work_BackgroundWorkerCompleted(object sender, BackgroundWorkerEventArgs e)
 {
 m_MainWindow.Show();
 this.Close();
 }

 /// <summary>
 /// 賦值
 /// </summary>
 /// <param name="text"></param>
 private delegate void SetProcessLabelDelegate(string text, double processValue);
 public void SetProcessValue(string text, double processValue)
 {
 if (!Dispatcher.CheckAccess())
 {
 Dispatcher.Invoke(DispatcherPriority.Send, new SetProcessLabelDelegate(SetProcessValue), text, processValue);
 return;
 }
 this.lblProcess.Content = text;
 this.ProgressControlRealValue.Value = processValue;
 }
 }
}

以上所述就是本文的全部內(nèi)容了,希望大家能夠喜歡。

聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

仿vs實現(xiàn)WPF好看的進(jìn)度條

仿vs實現(xiàn)WPF好看的進(jìn)度條:為了界面友好,一般的操作時間較長時,都需要增加進(jìn)度條提示。由于WPF自帶的進(jìn)度條其實不怎么好看,而且沒啥視覺效果。后來,裝VS2012時,發(fā)現(xiàn)安裝過程中進(jìn)度條效果不錯,于是上網(wǎng)查了資料。學(xué)習(xí)了ModernUI(開源的),地址:https://github.com/
推薦度:
標(biāo)簽: vs WPF 的進(jìn)度條
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 荆门市| 遵义县| 九台市| 桃江县| 江都市| 洪湖市| 翼城县| 镇远县| 探索| 宁波市| 醴陵市| 罗城| 宜城市| 舒城县| 沈丘县| 迭部县| 陵水| 通江县| 靖边县| 沙河市| 溧水县| 同江市| 内丘县| 鄂州市| 丰宁| 绍兴市| 唐海县| 金堂县| 五大连池市| 临安市| 都江堰市| 绥阳县| 汉中市| 澄迈县| 翁牛特旗| 道孚县| 外汇| 颍上县| 彩票| 富源县| 苗栗县|