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

网站服务器升级一般多久九龙坡区发布

网站服务器升级一般多久,九龙坡区发布,今天重庆发生大新闻,数字展馆公司使用wpf做一个原生的进度条#xff0c;进度条上面有值#xff0c;先看效果。 功能就是点击按钮#xff0c;后台处理数据#xff0c;前台显示处理数据的变化#xff0c;当然还可以对进度条进行美化和关闭的操作#xff0c;等待后台处理完毕数据#xff0c;然后自动关闭。…使用wpf做一个原生的进度条进度条上面有值先看效果。 功能就是点击按钮后台处理数据前台显示处理数据的变化当然还可以对进度条进行美化和关闭的操作等待后台处理完毕数据然后自动关闭。 1.首先简简单单创建一个项目 2.先建立进度条的页面DialogWait.xaml Window x:ClassWpfApp5.DialogWaitxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006xmlns:localclr-namespace:WpfApp5mc:IgnorabledWindowStyleNone AllowsTransparencyTrue BackgroundTransparent ShowInTaskbarFalse ResizeModeNoResizeProgressBar x:NameprogressBar Maximum100 Height25 Width300 HorizontalContentAlignmentCenter VerticalContentAlignmentCenter/ /Window3.DialogWait.xaml.cs后台代码如下 关键点就是要对max的值进行判断如果大于100和小于100的话显示是不一样的主要是因为进度条的值是100要相对的扩大或者缩小那么界面上显示的数据变化就是一样的。 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.Shapes;namespace WpfApp5 {/// summary/// DialogWait.xaml 的交互逻辑/// /summarypublic partial class DialogWait : Window{/// summary/// 进度条最大值/// /summaryprivate int max 0;/// summary/// 大于100的增量/// /summaryprivate int increment 0;/// summary/// 小于100的增量/// /summaryprivate double incrementLess 0;public DialogWait(){InitializeComponent();}public DialogWait(int max){InitializeComponent();this.Width 300;this.Height 25;this.Owner Application.Current.MainWindow;this.WindowStartupLocation WindowStartupLocation.CenterOwner;this.max max;if (max 100){increment max / 100;}else{incrementLess Math.Round(100.0 / max, 3);}}public void ShowWait(int value){progressBar.Dispatcher.Invoke(() {if (max 100){progressBar.Value value / increment;}else{progressBar.Value Math.Round(value * incrementLess, 0);}});}} }4.MainWindow.xaml.cs的代码 其中最重要的就是Task using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; 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 WpfApp5 {/// summary/// Interaction logic for MainWindow.xaml/// /summarypublic partial class MainWindow : Window{public MainWindow(){InitializeComponent();}private void Button_Click(object sender, RoutedEventArgs e){DialogWait dialogWaitPercent new DialogWait(500);Task.Run(() {A(dialogWaitPercent);//处理数据});dialogWaitPercent.ShowDialog();}public void A(DialogWait dialogWaitPercent){for (int i 0; i 500; i){dialogWaitPercent.ShowWait(i);Thread.Sleep(10);}dialogWaitPercent.Dispatcher.Invoke(() {dialogWaitPercent.Close();});}} }5.ProgressBarStyle.xaml最后就是对进度条的美化样式 ResourceDictionary xmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlStyle TargetType{x:Type ProgressBar}Setter PropertyFocusVisualStyle Value{x:Null}/Setter PropertySnapsToDevicePixels ValueTrue/Setter PropertyHeight Value15/Setter PropertyBackground Value#6fae5f/Setter PropertyFontSize Value10/Setter PropertyPadding Value5,0/Setter PropertyTemplateSetter.ValueControlTemplate TargetType{x:Type ProgressBar}Grid Background#00000000Grid.RowDefinitionsRowDefinition HeightAuto//Grid.RowDefinitionsVisualStateManager.VisualStateGroupsVisualStateGroup x:NameCommonStatesVisualState x:NameDeterminate/VisualState x:NameIndeterminateStoryboard RepeatBehaviorForeverPointAnimationUsingKeyFrames Storyboard.TargetNameAnimation Storyboard.TargetProperty(UIElement.RenderTransformOrigin)EasingPointKeyFrame KeyTime0:0:0 Value0.5,0.5/EasingPointKeyFrame KeyTime0:0:1.5 Value1.95,0.5/EasingPointKeyFrame KeyTime0:0:3 Value0.5,0.5//PointAnimationUsingKeyFrames/Storyboard/VisualState/VisualStateGroup/VisualStateManager.VisualStateGroupsGrid Height{TemplateBinding Height}Border Background#000000 CornerRadius7.5 Opacity0.05/Border BorderBrush#000000 BorderThickness1 CornerRadius7.5 Opacity0.1/Grid Margin{TemplateBinding BorderThickness}Border x:NamePART_Track/Grid x:NamePART_Indicator ClipToBoundsTrue HorizontalAlignmentLeft Grid.ColumnDefinitionsColumnDefinition x:Namewidth1/ColumnDefinition x:Namewidth2 Width0//Grid.ColumnDefinitionsGrid x:NameAnimation RenderTransformOrigin0.5,0.5Grid.RenderTransformTransformGroupScaleTransform ScaleY-1 ScaleX1/SkewTransform AngleY0 AngleX0/RotateTransform Angle180/TranslateTransform//TransformGroup/Grid.RenderTransformBorder Background{TemplateBinding Background} CornerRadius7.5Viewbox HorizontalAlignmentLeft StretchDirectionDownOnly Margin{TemplateBinding Padding} SnapsToDevicePixelsTrueTextBlock Foreground#ffffff SnapsToDevicePixelsTrue FontSize{TemplateBinding FontSize} VerticalAlignmentCenter Text{Binding RelativeSource{RelativeSource TemplatedParent},PathValue,StringFormat{}{0}%} RenderTransformOrigin0.5,0.5TextBlock.RenderTransformTransformGroupScaleTransform ScaleY1 ScaleX-1/SkewTransform AngleY0 AngleX0/RotateTransform Angle0/TranslateTransform//TransformGroup/TextBlock.RenderTransform/TextBlock/Viewbox/BorderBorder BorderBrush#000000 BorderThickness1 CornerRadius7.5 Opacity0.1//Grid/Grid/Grid/Grid/GridControlTemplate.TriggersTrigger PropertyIsEnabled ValueFalseSetter PropertyBackground Value#c5c5c5//TriggerTrigger PropertyIsIndeterminate ValuetrueSetter TargetNamewidth1 PropertyWidth Value0.25*/Setter TargetNamewidth2 PropertyWidth Value0.725*//Trigger/ControlTemplate.Triggers/ControlTemplate/Setter.Value/Setter/Style /ResourceDictionary 本案例代码https://download.csdn.net/download/u012563853/88578158 来源WPF创建进度条-CSDN博客
http://www.dnsts.com.cn/news/21601.html

相关文章:

  • 天津网站吗h5自适应网站建设
  • 唯品会网站建设 分析报告wordpress当前分类页面地址
  • 什么网站可以做新闻听写网站建设 域名 数据库
  • 做网站都有什么成本中国五大网站建设公司
  • 烟台网站建设 共赢网推app怎么推广
  • 做3d图的网站常州市网站建设公司
  • 个人做外贸接订单网站宜昌建站
  • 公司建立网站的必要性万州哪里有做网站的
  • 网站外链推广平台dedecms手机网站模板
  • 管理培训网站建设上网行为管理
  • qq游戏做任务领铜板网站wordpress自己写插件
  • 免费建网站抚顺网站短链接怎么做
  • 深圳做网站排名公司推荐外包做网站大概多少钱
  • 锦州做网站公司哪家好元器件采购最好的网站
  • 网站建设与维护课程设计建设工程包括什么工程
  • 怎么做扫二维码登陆网站服务器 网站建设
  • 网站推广 软件重庆网站建设快速建站
  • 佛山做一个自己的网站紫网站建设
  • 苏州建设工程协会网站做网站开发钱
  • ps做网站logo网站开发需求评估
  • 找阿里巴巴购买做网站的软件重庆建筑工程网
  • 网站备案当面核验拍摄照片wordpress生成静态html页面
  • 如何为企业网站设计完整的推广方案腾讯云win建设网站
  • 网站可以用视频做背景吗网站优化细节
  • 网站建设哪种好手机网站设计规格
  • 网站怎么放404页面超全wordpress
  • 网络推广专员宜春网站推广优化
  • 手表网站大全网站优化费用怎么做会计分录
  • 站酷的网址网页转app制作工具 安卓
  • 山东泰安房价2023最新价格网络优化工程师主要负责什么工作