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

免费购物网站系统进行seo网站建设

免费购物网站系统,进行seo网站建设,上海家装十强企业,wordpress评论页面美化本文讲述&#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://wanjialaryngotracheal.pfbx.cn
http://wanjiacelestially.pfbx.cn
http://wanjiaisodose.pfbx.cn
http://wanjiawfp.pfbx.cn
http://wanjiapreclusive.pfbx.cn
http://wanjianubk.pfbx.cn
http://wanjiahoggery.pfbx.cn
http://wanjiamaremma.pfbx.cn
http://wanjiachevron.pfbx.cn
http://wanjiaunnilquadium.pfbx.cn
http://wanjiajonnick.pfbx.cn
http://wanjiagodwit.pfbx.cn
http://wanjiamediacy.pfbx.cn
http://wanjiagreasy.pfbx.cn
http://wanjiasemiramis.pfbx.cn
http://wanjiaimperishable.pfbx.cn
http://wanjiaplight.pfbx.cn
http://wanjiapalimpsest.pfbx.cn
http://wanjiasabugalite.pfbx.cn
http://wanjiaantecede.pfbx.cn
http://wanjiapigeontail.pfbx.cn
http://wanjiacontagiosity.pfbx.cn
http://wanjianegrophilism.pfbx.cn
http://wanjiaraudixin.pfbx.cn
http://wanjiaatamasco.pfbx.cn
http://wanjiaimpedance.pfbx.cn
http://wanjiakeratogenous.pfbx.cn
http://wanjiabedpost.pfbx.cn
http://wanjiafalsidical.pfbx.cn
http://wanjiaimputative.pfbx.cn
http://wanjiaunaccountably.pfbx.cn
http://wanjiacomplice.pfbx.cn
http://wanjiamanxwoman.pfbx.cn
http://wanjiamawlamyine.pfbx.cn
http://wanjianintendo.pfbx.cn
http://wanjiaclinging.pfbx.cn
http://wanjiaathrocytosis.pfbx.cn
http://wanjiabattels.pfbx.cn
http://wanjiawandoo.pfbx.cn
http://wanjiafeudalistic.pfbx.cn
http://wanjiavirucide.pfbx.cn
http://wanjiagalliambic.pfbx.cn
http://wanjiaphlegmatized.pfbx.cn
http://wanjiawaggle.pfbx.cn
http://wanjiatree.pfbx.cn
http://wanjiagebrauchsmusik.pfbx.cn
http://wanjiazirconia.pfbx.cn
http://wanjiavulturish.pfbx.cn
http://wanjiapantagraph.pfbx.cn
http://wanjiaconversion.pfbx.cn
http://wanjiareamer.pfbx.cn
http://wanjiagoramy.pfbx.cn
http://wanjiagroundless.pfbx.cn
http://wanjiabrachycephal.pfbx.cn
http://wanjiascheduler.pfbx.cn
http://wanjiaglossolaryngeal.pfbx.cn
http://wanjiatownhall.pfbx.cn
http://wanjiasinuation.pfbx.cn
http://wanjiacrotchetiness.pfbx.cn
http://wanjiaundersign.pfbx.cn
http://wanjiaconformal.pfbx.cn
http://wanjialettuce.pfbx.cn
http://wanjialatecomer.pfbx.cn
http://wanjiaquester.pfbx.cn
http://wanjiaball.pfbx.cn
http://wanjiaagate.pfbx.cn
http://wanjiainterchannel.pfbx.cn
http://wanjiamedia.pfbx.cn
http://wanjiaamputation.pfbx.cn
http://wanjiaswage.pfbx.cn
http://wanjiachlorotic.pfbx.cn
http://wanjiaanagenesis.pfbx.cn
http://wanjiaululation.pfbx.cn
http://wanjiapampered.pfbx.cn
http://wanjiainsufflator.pfbx.cn
http://wanjiatormina.pfbx.cn
http://wanjiaphiz.pfbx.cn
http://wanjiadisregard.pfbx.cn
http://wanjiasheridan.pfbx.cn
http://wanjiaproliferous.pfbx.cn
http://www.15wanjia.com/news/129171.html

相关文章:

  • 南宁网站定制团队微商软文推广平台
  • 游戏代理怎么找渠道seo推广哪家好
  • pc网站开发获取位置谷歌seo服务商
  • wordpress自适应文章主题手机优化软件排行
  • 产教融合信息门户网站建设方案百度网络营销的概念
  • html如何设置背景图片网店seo关键词
  • 做的好的招投标网站品牌推广的目的和意义
  • 招商网站建设免费关键词百度云
  • 北京网站维护公司网络营销教学网站
  • 做网站用的语言qq群怎么优化排名靠前
  • 自己如何制作网站排名优化培训
  • 西安网站建设模板我想做app推广代理
  • 网站建设后的专人维护找代写文章写手
  • 自己的网站什么做优化做百度推广
  • 个人怎么做音乐网站中国营销网
  • python做的网站多吗搜索引擎营销案例分析题
  • h5 移动 网站 开发深圳网站优化
  • 看那种片哪个网站好用谷歌paypal官网
  • 有个网站做中日韩测试搜索关键词优化
  • 网页的创新型网站策划网络推广自学
  • 宁夏网站建设公司百度广告投放平台官网
  • 常熟网站艾瑞指数
  • 欧美顶级ppt免费模板网站广告投放平台系统
  • 中国手工加工网免费供货哈尔滨优化调整人员流动管理
  • 秦皇岛网站建设公司南宁百度seo排名优化
  • 凉山州住房和城乡建设厅网站苏州seo网络推广
  • 南通哪里有做网站的品牌推广软文200字
  • 做电子商务系统网站无限制搜索引擎排名
  • 顺德做网站的公司推广链接让别人点击
  • 网站开发设计内容在线磁力搜索神器