嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元微信扫码支付:2 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
wpf模拟弹出窗口的代码,模拟加载时,弹出提示信息
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.Shapes;
using System.Windows.Threading;
namespace WpfApplication4
{
/// <summary>
/// Window2.xaml 的交互逻辑
/// </summary>
public partial class Window2 : Window
{
long _start;
DispatcherTimer timer;
DispatcherTimer _closetime;
public Window2()
{
InitializeComponent();
timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromMilliseconds(1);
_start = Environment.TickCount;
timer.Tick = timer_Tick;
timer.IsEnabled = true;
this.Left = SystemParameters.WorkArea.Width - this.Width;
this.EndTop = SystemParameters.WorkArea.Height - this.Height;
this.Top = SystemParameters.WorkArea.Height;
}
void _closetime_Tick(object sender, EventArgs e)
{
this.Close();
}
public double EndTop { get; set; }
void timer_Tick(object sender, EventArgs e)
{
while (this.Top > EndTop)
{
this.Top -= 0.1;
}
_closetime = new DispatcherTimer();
_closetime.Interval = TimeSpan.FromMilliseconds(10000);
_closetime.Tick = _closetime_Tick;
_closetime.IsEnabled = true;
}
private void Window_Loaded_1(object sender, RoutedEventArgs e)
{
timer.Start();
}
}
}