WFP loading 窗口显示 SplashScreen
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
SplashScreen splashScreen = new SplashScreen("pic.jpg");
splashScreen.Show(true);
base.OnStartup(e);
}
}
这个系统自带的 SplashScreen 不是太好,不能自定义。。。
下面是我自定义的 SplashWind :
canCloseSplash 用来判断是否可以关闭这个loading自定义窗口。原理是在主窗口的Loaded事件里设置 App.canCloseSplash =true;
在自定义的SplashWind 里用个计时器检查 App.canCloseSplash 是否=true,等于的话就关闭自己。
public partial class App : System.Windows.Application
{
public static bool canCloseSplash = false; protected override void OnStartup(System.Windows.StartupEventArgs e)
{
SplashWind splashWind = new SplashWind();
splashWind.Show();
// System.Windows.SplashScreen splashScreen = new System.Windows.SplashScreen("1.jpg");
// splashScreen.Show(true,true);
base.OnStartup(e); }
}
public partial class SplashWind : Window
{
public SplashWind()
{
InitializeComponent();
Topmost = true;
t.Interval = TimeSpan.FromMilliseconds(30);
t.Tick += new EventHandler(t_Tick);
t.Start();
} DispatcherTimer t = new DispatcherTimer(); void t_Tick(object sender, EventArgs e)
{
if (App.canCloseSplash) {
t.Stop();
Close(); }
} }
SplashWind UI:
<Window x:Class="TestWebBrowser.SplashWind"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="SplashWind" Height="313" Width="509"
ResizeMode="NoResize" WindowStyle="None" ShowInTaskbar="False"
WindowStartupLocation="CenterScreen" Background="Blue" BorderThickness="5" BorderBrush="AliceBlue"
>
<Grid>
<Label Foreground="White" FontSize="22" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">Loading........</Label>
</Grid>
</Window>
主窗口Loaded事件里告诉SplashWind可以关闭了:
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
App.canCloseSplash = true;
}
WFP loading 窗口显示 SplashScreen的更多相关文章
- Windows MFC 两个OpenGL窗口显示与线程RC问题
问题为:背景界面是一个OpenGL窗口(对话框),在其上弹出一个OpenGL窗口(模态对话框)时, 1.上方的OpenGL窗口能响应鼠标操作等并刷新: 2.当移动或放大缩小上方的OpenGL窗口时,其 ...
- 关于ajax载入窗口使用RedirectToAction在窗口显示的问题
在过滤器中过滤用户是否登录,没有登录就RedirectToAction("Login", "Auth", new { Area = "Account& ...
- Android: Service中创建窗口显示
WindowManager.LayoutParams: int TYPE_SYSTEM_ALERT Window type: system window, such as low power ale ...
- Win32编程:窗口类样式+窗口外观样式+窗口显示样式
1.窗口类样式WNDCLASS.style CS_VREDRAW 提供窗口位置变化事件和高度变化事件的处理程序,功能是重绘窗口 CS_HREDRAW 提供窗口位置变化事件和宽度变化事件的处理程序,功能 ...
- visual studio 2005 编fortran程序,运行后dos窗口显示问题
比如程序: program main implicit none write(*,*) "AAAAAAAAAAAAAAAAAAAAAAAA" stop end 虽然可以看见DOS窗 ...
- jquery ajax请求方式与提示用户正在处理请稍等,等待数据返回时loading的显示
1.jquery ajax请求方式与提示用户正在处理请稍等 为了提高用户体验度,我们通常会给出 “正在处理,请稍等!”诸如此类的提示.我们可通过设置$.ajax()下的参数beforeSend()来实 ...
- QApplication::alert 如果窗口不是活动窗口,则会向窗口显示一个警告(非常好用,效果就和TeamViewer一样)
void QApplication::alert(QWidget * widget, int msec = 0)如果窗口不是活动窗口,则会向窗口显示一个警告.警报会显示msec 毫秒.如果毫秒为零,闪 ...
- 转】MySQL客户端输出窗口显示中文乱码问题解决办法
原博文出自于: http://www.cnblogs.com/xdp-gacl/p/4008095.html 感谢! 最近发现,在MySQL的dos客户端输出窗口中查询表中的数据时,表中的中文数据都显 ...
- Android 应用程序窗口显示状态操作(requestWindowFeature()的应用)
我们在开发程序是常常会须要软件全屏显示.自己定义标题(使用button等控件)和其它的需求,今天这一讲就是怎样控制Android应用程序的窗口显示. 首先介绍一个重要方法那就是requestWi ...
随机推荐
- SQLServer 远程链接MySql数据库详解
SQLServer 远程链接MySql数据库详解 by:授客 QQ:1033553122 测试环境: Microsoft Windows XP Professional 版本2000 Service ...
- arm64 调试环境搭建及 ROP 实战
前言 比赛的一个 arm 64 位的 pwn 题,通过这个题实践了 arm 64 下的 rop 以及调试环境搭建的方式. 题目文件 https://gitee.com/hac425/blog_data ...
- webpack中配置Babel
Babel是一个javascript编译器,可以将ES6和更新的js语法转换成ES5的,使代码在较老的浏览器里也能正常运行. 一.安装 npm install --save-dev babel-loa ...
- 70部MAYA灯光材质渲染教程合集
MAYA灯光材质渲染教程合集 教程格式:MP4和flv 两种格式 使用版本:教程不是一年出的教程,各个版本都有 (教程软件为英文版) 清晰度:可以看清软件上的文字 语言:部分中文字幕,其他英文(通过看 ...
- 在Docker Swarm上部署Apache Storm:第2部分
[编者按]本文来自 Baqend Tech Blog,描述了如何在 Docker Swarm,而不是在虚拟机上部署和调配Apache Storm集群.文章系国内 ITOM 管理平台 OneAPM 编译 ...
- AWS CSAA -- 04 AWS Object Storage and CDN - S3 Glacier and CloudFront(三)
021 Storage Gateway 022 Snowball 023 Snowball - Lab 024 S3 Transfer Acceleration
- zabbix agent 3.4 安装指南
从官方网站www.zabbix.com 下载zabbix agent安装包.目前最新版本是4.0 LTS release. 在需要监控的服务器上安装zabbix agent. 先解压安装包. 配置 c ...
- KMP、扩展KMP、Manacher习题
照着这篇博客刷一下. 自己也做一下笔记 对于KMP算法,可以看我之前总结的这篇博客 hdu 3613 Best Reward 给一个字符串,字符由a~z构成,每个字符有一个权值.在某一点将字符串切成2 ...
- Mac如何搭建 配置 virtualenv python虚拟环境(超级详细,适合小白)
首先去python官网 下载python3的 安装包安装: https://www.python.org/ftp/python/3.6.5/python-3.6.5-macosx10.9.pkg 安装 ...
- VS2017C++单元测试
0.欢迎食用 希望对点进来的你有所帮助. 全文记流水账,内心想法如示例项目名称. 1.建立需测试的项目 新建项目 正常书写.h 和.cpp文件 2.新建单元测试 右击解决方案 -> 添加 -&g ...