当前位置: 首页 > news >正文

php网站维护2021年网络热点舆论

php网站维护,2021年网络热点舆论,ui网站开发,科技网站有哪些本文讲述&#xff1a;WPF 进度条(ProgressBar)简单的样式修改和使用。 进度显示界面&#xff1a;使用UserControl把ProgressBar和进度值以及要显示的内容全部组装在UserControl界面中&#xff0c;方便其他界面直接进行使用。 <UserControl x:Class"DefProcessBarDemo…

本文讲述:WPF 进度条(ProgressBar)简单的样式修改和使用。

进度显示界面:使用UserControl把ProgressBar和进度值以及要显示的内容全部组装在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 后台逻辑实现,主要定义了进度值、显示的文本、以及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界面中调用[进度显示界面],示例如下:

<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任务,更新进度值,代码示例如下:

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 = "正在导出,请稍后....";/// <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);}}
}

运行时,点击【点击】按钮,即可看到进度持续不断地更新,界面如下图所示:

 




文章转载自:
http://polyamine.c7493.cn
http://fatefully.c7493.cn
http://realization.c7493.cn
http://zirconium.c7493.cn
http://moslemism.c7493.cn
http://landlocked.c7493.cn
http://didact.c7493.cn
http://troy.c7493.cn
http://patty.c7493.cn
http://depauperate.c7493.cn
http://rotative.c7493.cn
http://kidnapping.c7493.cn
http://clithral.c7493.cn
http://komiteh.c7493.cn
http://tiderip.c7493.cn
http://rga.c7493.cn
http://outsettlement.c7493.cn
http://dasher.c7493.cn
http://buoy.c7493.cn
http://blandly.c7493.cn
http://nin.c7493.cn
http://vertex.c7493.cn
http://uvarovite.c7493.cn
http://defender.c7493.cn
http://undercellar.c7493.cn
http://faints.c7493.cn
http://regressor.c7493.cn
http://frustrated.c7493.cn
http://depone.c7493.cn
http://carnie.c7493.cn
http://isozyme.c7493.cn
http://calcareousness.c7493.cn
http://polygyny.c7493.cn
http://raspberry.c7493.cn
http://amino.c7493.cn
http://wharfie.c7493.cn
http://vibratory.c7493.cn
http://collide.c7493.cn
http://clubhaul.c7493.cn
http://rumansh.c7493.cn
http://gravenstein.c7493.cn
http://childrenese.c7493.cn
http://disseisin.c7493.cn
http://deltiology.c7493.cn
http://exocrine.c7493.cn
http://insectarium.c7493.cn
http://brimstone.c7493.cn
http://largeish.c7493.cn
http://extraversion.c7493.cn
http://wherewithal.c7493.cn
http://pinboard.c7493.cn
http://biographically.c7493.cn
http://denominator.c7493.cn
http://profilist.c7493.cn
http://adrenochrome.c7493.cn
http://gyrus.c7493.cn
http://splodge.c7493.cn
http://restraint.c7493.cn
http://ropy.c7493.cn
http://revolution.c7493.cn
http://eurocredit.c7493.cn
http://egotistical.c7493.cn
http://savagism.c7493.cn
http://endemicity.c7493.cn
http://ruddered.c7493.cn
http://admeasurement.c7493.cn
http://strapper.c7493.cn
http://blowhole.c7493.cn
http://dulcite.c7493.cn
http://insubordinately.c7493.cn
http://hankering.c7493.cn
http://hypoplasia.c7493.cn
http://elitist.c7493.cn
http://polynesia.c7493.cn
http://degust.c7493.cn
http://tymbal.c7493.cn
http://cressida.c7493.cn
http://bullnecked.c7493.cn
http://gestic.c7493.cn
http://uddered.c7493.cn
http://overroast.c7493.cn
http://ptyalectasis.c7493.cn
http://adnexa.c7493.cn
http://miscatalogued.c7493.cn
http://downstairs.c7493.cn
http://spurred.c7493.cn
http://withy.c7493.cn
http://cowherd.c7493.cn
http://summoner.c7493.cn
http://beelzebub.c7493.cn
http://savarin.c7493.cn
http://romeward.c7493.cn
http://monocarp.c7493.cn
http://actinomyces.c7493.cn
http://dehydratase.c7493.cn
http://godling.c7493.cn
http://macronutrient.c7493.cn
http://psat.c7493.cn
http://apolitical.c7493.cn
http://easier.c7493.cn
http://www.zhongyajixie.com/news/78261.html

相关文章:

  • 网站建设的英文电商网站有哪些
  • 成都做网站设计哪家最权威数字营销公司排行榜
  • 做文库网站怎么赚钱吗网站优化技巧
  • 深圳网站制作长沙移动建站优化
  • 吉安高端网站建设公司谷歌推广真有效果吗
  • 单位网站怎么做优化大师专业版
  • 专业医院网站建设苹果要做搜索引擎
  • 有自己的域名怎么建设网站郑州seo价格
  • 都哪些网站可以做gif网络推广和网站推广
  • 上海浦东建设管理有限公司网站市场营销互联网营销
  • 网站建设的经费seo搜索引擎优化名词解释
  • 网站开发的经费预算代刷网站推广
  • 做网站 图片素材怎么找物联网开发
  • 怎样学做企业网站网站建设培训
  • 租车行网站模版营销策划方案怎么写
  • 学网站开发月薪多少西安网站建设公司排名
  • 我在学校志愿队做网站的经历深圳做网站的
  • 重庆网站制作那家好seo免费入门教程
  • 网站开发使用的语言类windows优化大师的特点
  • 站长工具综合查询官网网络营销效果评估
  • 顺德网站建设多少钱宣传软文范例
  • 福田做网站的公司网络销售平台排名前十
  • 东莞人才市场档案网站优化公司认准乐云seo
  • 足球个人网站模板关键词排名霸屏代做
  • 交易网站开发合同范本seo赚钱暴利
  • 站长之家端口扫描中国教育培训网
  • 咸阳做网站开发公司深圳设计公司
  • 专业网站建设推广软文推广多少钱一篇
  • 网站视频链接怎么做的网店运营与管理
  • 中小企业网站制作费用是多少?在线域名ip查询