如何根据特定时间显示页面(窗口,页面,用户控件) [英] How to show a page(window,page,usercontrol) based on particular time

查看:64
本文介绍了如何根据特定时间显示页面(窗口,页面,用户控件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在wpf上工作.

因此,根据我的要求,我将所有页面的主窗口与视图框一起设计.

主窗口有6页.所以,这里

第一次时将仅显示一个窗口,在特定时间后将显示另一个窗口.

在Windows应用程序中,这是可能的,因为计时器控制是其中的一种,但是wpf如何实现此功能.

让我知道如何实现吗?

在此先感谢...........

hi all,

im working on wpf.

so as my requirement im desgining the mainwindow with viewbox for all pages.

the mainwindow have 6 pages. So, here

at the first time only one window will be display after particular time will be show another window.

in windows application it is possible because timer control is ther but wpf how can do this functionality.

Let me know how to implement this?

Thanks in advance...........

推荐答案

使用DispatcherTimer [
Use DispatcherTimer[^]
System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
dispatcherTimer.Interval = new TimeSpan(0,0,1); // 1 sec
dispatcherTimer.Start();


private void dispatcherTimer_Tick(object sender, EventArgs e)
{
  // code goes here
  // close current window
  // show new window 
}


这篇关于如何根据特定时间显示页面(窗口,页面,用户控件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆