A Popup Progress Window
一个包含bar和取消而且不需要资源弹出窗口
1.构造函数
CProgressWnd();
CProgressWnd(CWnd* pParent, LPCTSTR strTitle, BOOL bSmooth=FALSE);
BOOL Create(CWnd* pParent, LPCTSTR strTitle, BOOL bSmooth=FALSE);
参数说明:
pParent//父窗口
strTitle//窗口标题
bSmooth//是否平滑
2.方法属性
BOOL GoModal(LPCTSTR strTitle = _T("Progress"), BOOL bSmooth=FALSE);
// Make window modal
int SetPos(int nPos); // Same as CProgressCtrl
int OffsetPos(int nPos); // Same as CProgressCtrl
int SetStep(int nStep); // Same as CProgressCtrl
int StepIt(); // Same as CProgressCtrl
void SetRange(int nLower, int nUpper, int nStep = 1);
// Set min, max and step size
void Hide(); // Hide the window
void Show(); // Show the window
void Clear(); // Clear the text and reset the
// progress bar
void SetText(LPCTSTR fmt, ...); // Set the text in the text area
BOOL Cancelled() // Has the cancel button been pressed?
void SetWindowSize(int nNumTextLines, int nWindowWidth = 390);
// Sets the size of the window
// according to the number of text
// lines specifed and the
// desired window size in pixels.
void PeekAndPump(BOOL bCancelOnESCkey = TRUE);
// Message pumping, with options of
// allowing Cancel on ESC key.
SetWindowSize()默认显示四行
PeekAndPump()防止消息阻塞,在走进度过程中,相关操作可以继续执行,如esc取消,鼠标点击等等
3例子
通过GoModal()显示
CProgressWnd wndProgress(this, "Progress"); // wndProgress.GoModal(); // Call this if you want a modal window
wndProgress.SetRange(0,5000);
wndProgress.SetText("Processing..."); for (int i = 0; i < 5000; i++) {
wndProgress.StepIt();
wndProgress.PeekAndPump(); if (wndProgress.Cancelled()) {
MessageBox("Progress Cancelled");
break;
}
}
或者Create()
CProgressWnd wndProgress; if (!wndProgress.Create(this, "Progress"))
return; wndProgress.SetRange(0,5000);
wndProgress.SetText("Processing...");
源代码链接地址:http://download.csdn.net/detail/wuyuan2011woaini/9594242
A Popup Progress Window的更多相关文章
- Popup a window before the MainWindow
protected override void OnStartup(StartupEventArgs e) { Window w = new Window(); w.ShowDialog(); bas ...
- Pass value from child popup window to parent page window using JavaScript--reference
Here Mudassar Ahmed Khan has explained how to pass value from child popup window to parent page wind ...
- BOM 浏览器对象模型_window 对象的常见 window.属性_window.方法
1. 常用属性 window.devicePixelRatio 像素比 = css / 物理像素 window.scrollX,window.scrollY 滚动条 卷曲距离 if ...
- WPF Popup全屏 弹出方法。解决只显示75%的问题。
WPF Popup全屏 弹出方法.解决只显示75%的问题. WPF 中 Popup 有一个特点.当Popup的高度超过屏幕的75%的时候,只显示75%的高度. 如下代码: <Window x ...
- popup的简单应用举例(具体在增删改查组件中用到)以及补充的知识点
一.首先说一下自执行函数 1. 立即执行函数是什么?也就是匿名函数 立即执行函数就是 声明一个匿名函数 马上调用这个匿名函数 2.popup的举例 点击,弹出一个新的窗口.保存完事,页面不刷新数据就返 ...
- python 全栈开发,Day117(popup,Model类的继承,crm业务开发)
昨日内容回顾 第一部分:权限相关 1. 权限基本流程 用户登录成功后获取权限信息,将[权限和菜单]信息写入到session. 以后用户在来访问,在中间件中进行权限校验. 为了提升用户体验友好度,在后台 ...
- window.open() & iframe
window.open() & iframe https://www.w3schools.com/jsref/met_win_open.asp window.open(URL, name, s ...
- popup的简单应用举例
一.首先说一下自执行函数 1. 立即执行函数是什么?也就是匿名函数 立即执行函数就是 声明一个匿名函数 马上调用这个匿名函数 2.popup的举例 点击,弹出一个新的窗口.保存完事,页面不刷新数据就返 ...
- WPF popup控件的使用
<Window x:Class="WPFPopup.RuntimePopup" xmlns="http://schemas.microsoft.com/wi ...
随机推荐
- 使用Architecture Explorer分析应用程序及使用层次图
使用Architecture Explorer分析应用程序 Architecture Explorer和依赖图可以帮助我们了解所有的项目,包括小项目和大项目.Architecture Explorer ...
- SQL Server 2008 评估期已过解决方法
SQL Server 2008有180天的试用期,过期后会提示“评估期已过”的提示. 1.进入SQL Server安装中心: 2.选择“维护”-“版本升级” 3.输入密钥: 其他的根据提示操作. 附S ...
- Orchard 异常
在Orchard项目中碰的各种错误整理 1 打开网站出现404 . 查看日志 日志位置Orchard.Web\App_Data\Logs\orchard-error-2016.03.23.log 错误 ...
- Discuz API的延伸
作为社交平台来使用Discuz的话,UC_Server提供的那些数据接口是不够用的,我们还需要访问及操作用户的扩展数据. 基于UXF框架的rest_controller,很容易就可以实现API接口. ...
- couchbase单向同步
我们知道,couchbase默认情况下就是N主的HA模式,bucket同时存储在多个节点中.如下所示: 但事实上,有些时候我们希望某些节点只能读,不能写以避免各种副作用以及分布式系统下出于管理和安全性 ...
- spring扫描classpath下特定package,并加载具有特定注解的接口
spring扫描classpath下特定package,并加载具有特定注解的接口. 在框架平台的开发中,通常有很多的情况通过spring配置方式来实现某些功能会使得框架平台难以使用和扩展,我们通常的做 ...
- 2013 最新的 play web framework 版本 1.2.3 框架学习文档整理
Play framework框架学习文档 Play framework框架学习文档 1 一.什么是Playframework 3 二.playframework框架的优点 4 三.Play Frame ...
- 关于一个js连续赋值问题之我见(词略穷,见谅)
前几天在搜索面试题时发现了这么一段代码,执行完后感觉完全不与所想的一样 var a = { n : 1 }; var b = a; a.x = a = {n : 2}; console.log(a.x ...
- C#将DataTable转化为List<T>
C#将DataTable转化为List<T> 在使用三层架构开发一个网站时,希望把DataTable对象转换为List<T>对象,于是在网上找资料,总结一个比较方便的方法来实现 ...
- 移动端调试工具-Debuggap
随着移动互联网的迅速崛起,开发移动应用程序越来越多,但如果在移动端开发应用程序需要调试时,额- 仿佛又回到了IE时代,最方便也只能到处 alert 来调试.目前已经有一款产品可以做到这一点,比如pho ...