EVC 之进度条使用

本文介绍了在Windows CE环境下如何创建并使用进度条控件。包括设置进度条范围、当前位置等关键步骤,并提供了CProgressCtrl类的具体用法及示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

作者:wogoyixikexie@gliet

    ————————————————————————————————

   我已经实现在wince下实现更新NK的flash驱动和EVC程序,但是这个EVC程序界面比较差劲,想加一些进度条给它,现在开始尝试。汪兵的书里面有些介绍,在这里先看看吧。

=======================================================================

现在再来看看EVC的帮助文档

——————————————

Setting the Range and Current Position

The range of a progress bar represents the entire duration of the operation, and the current position represents the progress that the application has made toward completing the operation. The window procedure uses the range and the current position of the progress bar to determine the percentage of the progress bar to fill with the highlight color, as well as to determine what text, if any, to display within the progress bar.

If you do not set the range values, the system sets the minimum value to zero and the maximum value to 100. You can adjust the range to convenient integers by using the PBM_SETRANGE message.

A progress bar provides several messages that you can use to set the current position. The PBM_SETPOS message sets the position to a specified value. The PBM_DELTAPOS message advances the position by adding a specified value to the current position. The PBM_SETSTEP message enables you to specify a step increment for a progress bar. Subsequently, when you send the PBM_STEPIT message to the progress bar, the current position advances by the specified increment. The default step increment is 10.

Note   The range values in a progress bar are considered signed integers. Any number that is greater than 0x7FFFFFFF is interpreted as a negative number

 

 

This method creates the progress bar control attached to this CProgressCtrl object.

To construct a CProgressCtrl object, call the constructor, which creates the CProgressCtrl object; then call Create.

BOOL Create( 
DWORD dwStyle, 
const RECT& rect, 
CWnd* pParentWnd, 
UINT nID ); 

Return Value

TRUE if the CProgressCtrl object is successfully created; otherwise, it is FALSE.

Parameters

dwStyle
Specifies the style of the progress bar control. Apply any combination of window styles described in CreateWindow, in addition to the following progress bar control styles, to the control:
  • PBS_VERTICAL   Displays progress information vertically, top to bottom. Without this flag, the progress bar control displays horizontally, left to right.
  • PBS_SMOOTH   Displays gradual, smooth filling in the progress bar control. Without this flag, the control will fill with blocks.
rect
Specifies the size and position of the progress bar control. It can be either a CRect object or a RECT structure. Because the control must be a child window, the specified coordinates are relative to the client area of the pParentWnd.
pParentWnd
Specifies the parent window of the progress bar control, usually a CDialog. It must not be NULL.
nID
Specifies the progress bar control ID.

Example

CProgressCtrl myCtrl;

// Create a smooth child progress control.
myCtrl.Create(WS_CHILD|WS_VISIBLE|PBS_SMOOTH, CRect(10,10,200,30), 
  pParentWnd, 1);

Requirements

  Windows CE versions: 1.0 and later  
  Header file: Declared in Afxcmn.h

 

遇到问题:在论坛发了帖子,解决了。http://topic.youkuaiyun.com/u/20081225/11/83c3d669-dd33-4510-a7db-c614054a92cf.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值