CProgressCtrl::SetPos
设置进度栏控件的当前位置为指定的 nPos 并重画该线条反映新位置。
int SetPos(
int nPos
);
参数
- nPos
进度栏控件的新位置。
返回值
进度栏控件的前面的位置。
备注
进度栏控件的位置不是屏幕的物理位置,而是在 SetRange指示的上限和下限的范围之内。
示例
CProgressCtrl myCtrl;
// Create a child progress control.
myCtrl.Create(WS_CHILD|WS_VISIBLE, CRect(10,10,200,30), pParentWnd,
IDC_PROGRESSCTRL);
// Set the range to be 0 to 100.
myCtrl.SetRange(0, 100);
// Set the position to be half, 50.
myCtrl.SetPos(50);
要求
Header: afxcmn.h