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 ...
随机推荐
- nginx的部署与发布
1.在http://nginx.org/en/download.html下载nginx.tar.gz包. 2.上传发送到服务器(wcp工具) 3.用tar -xf命令解压gz包 4.[配置安装变量]: ...
- css中zoom和transform:scale的区别
css中zoom和transform:scale的区别 关于zoom: 以前只是看到别人的代码中用过zoom,自己从未使用过,今天在探究ie7兼容inline-block时,发现里面提到了zoom.下 ...
- 【EF 译文系列】韧性连接、重试(EF 版本至少为 6)
原文链接:Connection Resiliency / Retry Logic (EF6 onwards) 一个应用程序的数据库连接,是非常容易受其它因素影响的,比如后端的异常或者不稳定的网络连接等 ...
- zTree的使用
一.节点模糊搜索功能:搜索成功后,自动高亮显示并定位.展开搜索到的节点. 二.节点异步加载:1.点击展开时加载数据:2.选中节点时加载数据. 前台代码如下: <script type=" ...
- 基于DevExpress开发的GridView如何实现一列显示不同的控件类型
在很多DevExpress的使用例子里面,我们可以看到,基于GridView实现的不同控件展示的时候,每一列的控件类型都是一样的,如果我要某一列的一行让用户可以从下列列表选择选项,而其他行不可选择,那 ...
- 2016C#模拟谷歌Google登陆Gmail&Youtube小案例
之所以写这个,是因为本来想写一个Youtube刷评论的工具,把登录做出来了,后面就没继续做下去. 涉及到基本的HttpWatch的应用以及Fiddler的应用(Fd主要用来排查问题,通过对比 浏览器和 ...
- map与vector---Email Aliases
Description Polycarp has quite recently learned about email aliases. Of course, he used to suspect t ...
- php5.6-Apache2.4-mysql5.6环境配置(win7_64位)
----------------------------------------------------- ★软件工具:(下载时注意下载相应版本,不同版本安装细节可能会有差异!!) 1>http ...
- EffectiveJava——接口优于抽象类
Java程序设计语言提供两种机制,可以用来定义允许多个实现的类型:接口和抽象方法,这两者直接醉为明显的区别在于,抽象类允许某些方法的实现,但接口不允许,一个更为重要的区别在于,为了实现由抽象类定义的类 ...
- innerHTML和outerHTML有什么区别
一.区别:1)innerHTML: 从对象的起始位置到终止位置的全部内容,不包括Html标签.2)outerHTML: 除了包含innerHTML的全部内容外, 还包含对象标签本身. 二.例子1: & ...