中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

php網(wǎng)站維護刷關(guān)鍵詞排名

php網(wǎng)站維護,刷關(guān)鍵詞排名,專業(yè)做網(wǎng)站公司哪家好,做網(wǎng)站一定要用服務(wù)器嗎本文講述&#xff1a;WPF 進度條(ProgressBar)簡單的樣式修改和使用。 進度顯示界面&#xff1a;使用UserControl把ProgressBar和進度值以及要顯示的內(nèi)容全部組裝在UserControl界面中&#xff0c;方便其他界面直接進行使用。 <UserControl x:Class"DefProcessBarDemo…

本文講述:WPF 進度條(ProgressBar)簡單的樣式修改和使用。

進度顯示界面:使用UserControl把ProgressBar和進度值以及要顯示的內(nèi)容全部組裝在UserControl界面中,方便其他界面直接進行使用。

<UserControl x:Class="DefProcessBarDemo.DefProcessBar"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:local="clr-namespace:DefProcessBarDemo"mc:Ignorable="d"x:Name="MyWatingViewControl"><UserControl.Background><VisualBrush><VisualBrush.Visual><Border x:Name="ControlBackground"Background="Black"Opacity="0.45" /></VisualBrush.Visual></VisualBrush></UserControl.Background><Viewbox x:Name="myViewBox"Stretch="UniformToFill"StretchDirection="DownOnly"UseLayoutRounding="True"><Grid Margin="0 0 0 0"HorizontalAlignment="Center"VerticalAlignment="Center"MouseDown="Image_MouseDown"><Border CornerRadius="5"SnapsToDevicePixels="True"><Border.Effect><DropShadowEffect Color="#000000"BlurRadius="10"ShadowDepth="3"Opacity="0.35"Direction="270" /></Border.Effect><Border Background="#4a4a4a"CornerRadius="5"Margin="5"BorderBrush="#9196a0"BorderThickness="1"SnapsToDevicePixels="True"><Grid Width="500"Height="150"><Grid.RowDefinitions><RowDefinition Height="auto" /><RowDefinition Height="35" /><RowDefinition Height="*" /><RowDefinition Height="30" /></Grid.RowDefinitions><Image Name="CloseIco"Width="25"Height="25"Margin="0,0,0,0"MouseDown="Image_MouseDown"HorizontalAlignment="Right"VerticalAlignment="Top" /><StackPanel Grid.Row="1"Orientation="Horizontal"HorizontalAlignment="Center"><TextBlock Text="{Binding Message,ElementName=MyWatingViewControl}"FontSize="18"Foreground="Yellow"TextWrapping="WrapWithOverflow"TextTrimming="CharacterEllipsis"MaxWidth="450"VerticalAlignment="Bottom" /><TextBlock Text="("FontSize="18"Foreground="Yellow"VerticalAlignment="Bottom" /><TextBlock Text="{Binding ElementName=progressBar, Path=Value, StringFormat={}{0:0}%}"FontSize="18"Foreground="Yellow"FontFamily="楷體"VerticalAlignment="Bottom" /><TextBlock Text=")"FontSize="18"Foreground="Yellow"VerticalAlignment="Bottom" /></StackPanel><Grid  Grid.Row="2"HorizontalAlignment="Center"VerticalAlignment="Top"Margin="0 10"><ProgressBar x:Name="progressBar"Maximum="100"Height="25"Width="420"Foreground="Green"Background="LightGray"HorizontalContentAlignment="Center"VerticalContentAlignment="Center"Value="{Binding ProcessBarValue,ElementName=MyWatingViewControl}" /></Grid></Grid></Border></Border></Grid></Viewbox>
</UserControl>

進度顯示界面:UserControl?后臺邏輯實現(xiàn),主要定義了進度值、顯示的文本、以及UserControl的大小。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;namespace DefProcessBarDemo
{/// <summary>/// DefProcessBar.xaml 的交互邏輯/// </summary>public partial class DefProcessBar : UserControl{public DefProcessBar(){InitializeComponent();this.Loaded += WaitingView_Loaded;}void WaitingView_Loaded(object sender, RoutedEventArgs e){if (this.Parent != null){var root = (FrameworkElement)this.Parent;if (root != null){this.Width = root.ActualWidth;this.Height = root.ActualHeight;ControlBackground.Width = root.ActualWidth;ControlBackground.Height = root.ActualHeight;}}}#region Propertypublic string Message{get { return (string)GetValue(MessageProperty); }set { SetValue(MessageProperty, value); }}public static readonly DependencyProperty MessageProperty = DependencyProperty.Register("Message", typeof(string), typeof(DefProcessBar),new PropertyMetadata(""));public double ProcessBarValue{get { return (double)GetValue(ProcessBarValueProperty); }set { SetValue(ProcessBarValueProperty, value); }}public static readonly DependencyProperty ProcessBarValueProperty = DependencyProperty.Register("ProcessBarValue", typeof(double), typeof(DefProcessBar),new PropertyMetadata(0.0));#endregionprivate void Image_MouseDown(object sender, MouseButtonEventArgs e){this.Visibility = Visibility.Hidden;}}
}

?在MainWindow界面中調(diào)用[進度顯示界面],示例如下:

<Window x:Class="DefProcessBarDemo.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:DefProcessBarDemo"mc:Ignorable="d" Title="DefProcessBar" Width="600" Height="500"WindowStartupLocation="CenterScreen" x:Name="mainwnd"xmlns:pdb="clr-namespace:DefProcessBarDemo" Background="Teal"><StackPanel><Button Height="30" Width="120" Margin="20" Content="點擊" Click="Button_Click"/><pdb:DefProcessBar VerticalAlignment="Center"ProcessBarValue="{Binding ExportValue, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"Message="{Binding ExportMessage, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />        </StackPanel>
</Window>

?后臺模擬進度變化,使用Task任務(wù),更新進度值,代碼示例如下:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;namespace DefProcessBarDemo
{/// <summary>/// MainWindow.xaml 的交互邏輯/// </summary>public partial class MainWindow : Window, System.ComponentModel.INotifyPropertyChanged{public MainWindow(){InitializeComponent();this.DataContext = this;}private string m_ExportMessage = "正在導(dǎo)出,請稍后....";/// <summary>/// /// <summary>public string ExportMessage{get { return m_ExportMessage; }set{m_ExportMessage = value;OnPropertyChanged("ExportMessage");}}private double m_ExportValue = 0.0;/// <summary>/// /// <summary>public double ExportValue{get { return m_ExportValue; }set{m_ExportValue = value;OnPropertyChanged("ExportValue");}}#region MyRegionpublic event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;protected void OnPropertyChanged(string propertyName){if (PropertyChanged != null){PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));}}#endregionprivate void Button_Click(object sender, RoutedEventArgs e){Task.Run(() =>{for(int i = 1; i < 101; i++){ExportValue++;System.Threading.Thread.Sleep(1000);if (ExportValue == 100)ExportMessage = "完成";}});string strRes = "";bool bRet = GetCmdResult("netsh wlan show profiles", out strRes);}}
}

運行時,點擊【點擊】按鈕,即可看到進度持續(xù)不斷地更新,界面如下圖所示:

?



http://www.risenshineclean.com/news/5571.html

相關(guān)文章:

  • 建一個購物網(wǎng)站多少錢吳江seo網(wǎng)站優(yōu)化軟件
  • 百度做的網(wǎng)站能優(yōu)化嗎網(wǎng)站的seo 如何優(yōu)化
  • wordpress 做的網(wǎng)站全球中文網(wǎng)站排名
  • seo網(wǎng)站建設(shè)廈門2022千鋒教育培訓(xùn)收費一覽表
  • 網(wǎng)站制作多少錢?個人網(wǎng)站制作教程
  • 類似情侶空間的網(wǎng)站開發(fā)制作網(wǎng)站平臺
  • 高端女裝有哪些品牌搜索引擎排名優(yōu)化seo
  • 銅川做網(wǎng)站電話顏色廣告
  • 燕郊網(wǎng)站建設(shè)公司企業(yè)網(wǎng)站推廣方案設(shè)計畢業(yè)設(shè)計
  • 南京 網(wǎng)站制作公司新網(wǎng)域名
  • 網(wǎng)站開發(fā)開票內(nèi)容寫什么產(chǎn)品關(guān)鍵詞大全
  • 林州網(wǎng)站建設(shè)拉新十大推廣app平臺
  • php網(wǎng)站優(yōu)點廈門seo培訓(xùn)
  • 做家教去哪個網(wǎng)站武漢seo價格
  • 企業(yè)網(wǎng)站建設(shè)與優(yōu)化深圳做推廣哪家比較好
  • 找大學(xué)生做家教去哪個網(wǎng)站找好關(guān)鍵詞seo深圳
  • 做網(wǎng)站搭建環(huán)境游戲推廣員一個月能賺多少
  • 網(wǎng)站登錄 效果代碼seo綜合查詢怎么用的
  • 濟南網(wǎng)站建設(shè)公網(wǎng)絡(luò)服務(wù)
  • 做網(wǎng)站推廣什么好友情鏈接網(wǎng)站源碼
  • 做公眾號的網(wǎng)站有哪些功能如何網(wǎng)站關(guān)鍵詞優(yōu)化
  • 做畢業(yè)論文的網(wǎng)站怎樣創(chuàng)建自己的網(wǎng)站
  • 網(wǎng)站建站網(wǎng)站的seo是什么意思?
  • 建網(wǎng)站盈利的幾種方式投放廣告
  • 哪些網(wǎng)站可以接設(shè)計的單子做培訓(xùn)管理平臺
  • 新的網(wǎng)站做淘寶客搜外網(wǎng)友情鏈接
  • 如何開始做b2b網(wǎng)站站長查詢工具
  • 江西省的建設(shè)廳官方網(wǎng)站社群營銷方案
  • 可以做引流網(wǎng)站的源碼全球搜怎么樣
  • 網(wǎng)站運營淘寶關(guān)鍵詞挖掘工具