Поделиться через


CProgressCtrl::SetPos

Sets the progress bar control's current position as specified by nPos and redraws the bar to reflect the new position.

int SetPos(
   int nPos 
);

Параметры

  • nPos
    New position of the progress bar control.

Возвращаемое значение

The previous position of the progress bar control.

Заметки

The position of the progress bar control is not the physical location on the screen, but rather is between the upper and lower range indicated in 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

См. также

Основные понятия

CProgressCtrl Class

CProgressCtrl Members

Hierarchy Chart

CProgressCtrl::OffsetPos

CProgressCtrl::SetRange

CProgressCtrl::StepIt