다음을 통해 공유


CScrollBar::SetScrollRange

지정 된 스크롤 막대의 최소 및 최대 위치 값을 설정합니다.

void SetScrollRange(
   int nMinPos,
   int nMaxPos,
   BOOL bRedraw = TRUE 
);

매개 변수

  • nMinPos
    최소 스크롤 위치를 지정 합니다.

  • nMaxPos
    최대 스크롤 위치를 지정 합니다.

  • bRedraw
    스크롤 막대의 변경 내용을 반영 하도록 다시 여부를 지정 합니다.경우 bRedraw 는 TRUE, 스크롤 막대가 다시 그려집니다. 경우 FALSE을 다시 그릴 수 있습니다.이 작업은 기본적으로 그려집니다.

설명

설정 nMinPos 및 nMaxPos 표준 스크롤 막대를 숨기려면 0.

스크롤 막대 알림 메시지를 처리 하는 동안 스크롤 막대를 숨기려면이 함수를 호출 하지 마십시오.

호출 하는 경우 SetScrollRange 호출 바로 뒤의 SetScrollPos 멤버 함수에 설정 bRedraw 에 SetScrollPos 스크롤 막대를 두 번 다시 제한 합니다.

지정 된 값의 차이 nMinPos 및 nMaxPos 32767 보다 크지 않아야 합니다.스크롤 막대 컨트롤에 대 한 기본 범위는 비어 있습니다 (둘 다 nMinPos 및 nMaxPos 0).

예제

// Sets minimum (0) and maximum (10) position values for the
// CScrollBar control. m_ScrollBarVert is of type CScrollBar class, 
// and it is a member variable in CMyDialog class.
m_ScrollBarVert.SetScrollRange(0, 10);

// Set the position of the scroll box.
m_ScrollBarVert.SetScrollPos(5);

// Disable the down arrow of the scroll bar. By default, both arrows 
// are enabled.
m_ScrollBarVert.EnableScrollBar(ESB_DISABLE_DOWN);

요구 사항

헤더: afxwin.h

참고 항목

참조

CScrollBar 클래스

계층 구조 차트

CScrollBar::GetScrollPos

CScrollBar::SetScrollPos

CScrollBar::GetScrollRange

SetScrollRange