我们有功能强大的
BOOL CWnd::SetScrollInfo( int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw = TRUE );要干什么吧,用它应该可以搞定的.各参数说明:
nBarSpecifies whether the scroll bar is a control or part of a window’s nonclient area. If it is part of the nonclient area, nBar also indicates whether the scroll bar is positioned horizontally, vertically, or both. It must be one of the following: SB_CTL Contains the parameters for a scroll bar control. The m_hWnd data member must be the handle of the scroll bar control.
SB_HORZ Specifies that the window is a horizontal scroll bar.
SB_VERT Specifies that the window is a vertical scroll bar.
lpScrollInfoA pointer to aSCROLLINFO structure. See the Win32 SDK Programmer’s Reference for more information about this structure.bRedrawSpecifies whether the scroll bar should be redrawn to reflect the new position. If bRedraw is TRUE, the scroll bar is redrawn. If it is FALSE, it is not redrawn. The scroll bar is redrawn by default.
关于SCROLLINFO结构的含义如下:
typedef struct tagSCROLLINFO {
UINT cbSize;
UINT fMask;
int nMin;
int nMax;
UINT nPage;
int nPos;
int nTrackPos;
} SCROLLINFO, *LPSCROLLINFO;
typedef SCROLLINFO CONST *LPCSCROLLINFOcbSize
Specifies the size, in bytes, of this structure.
fMask
Specifies the scroll bar parameters to set or retrieve. This member can be a combination of the following values: Value Meaning
SIF_ALL Combination of SIF_PAGE, SIF_POS, SIF_RANGE, and SIF_TRACKPOS.
SIF_DISABLENOSCROLL This value is used only when setting a scroll bar's parameters. If the scroll bar's new parameters make the scroll bar unnecessary, disable the scroll bar instead of removing it.
SIF_PAGE The nPage member contains the page size for a proportional scroll bar.
SIF_POS The nPos member contains the scroll box position, which is not updated while the user drags the scroll box.
SIF_RANGE The nMin and nMax members contain the minimum and maximum values for the scrolling range.
SIF_TRACKPOS The nTrackPos member contains the current position of the scroll box while the user is dragging it. 各成员含义:
nMin
Specifies the minimum scrolling position.
nMax
Specifies the maximum scrolling position.
nPage
Specifies the page size. A scroll bar uses this value to determine the appropriate size of the proportional scroll box.
nPos
Specifies the position of the scroll box.
nTrackPos
Specifies the immediate position of a scroll box that the user is dragging. An application can retrieve this value while processing the SB_THUMBTRACK request code. An application cannot set the immediate scroll position; the SetScrollInfo function ignores this member. 你以为类向导是什么啊?
MSDN三个月更新一次,VC集成环境可不是呀,要帮助应该找专业的帮助.
类向导只不过给你提供一点小小小小小的方便而已....
BOOL CWnd::SetScrollInfo( int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw = TRUE );要干什么吧,用它应该可以搞定的.各参数说明:
nBarSpecifies whether the scroll bar is a control or part of a window’s nonclient area. If it is part of the nonclient area, nBar also indicates whether the scroll bar is positioned horizontally, vertically, or both. It must be one of the following: SB_CTL Contains the parameters for a scroll bar control. The m_hWnd data member must be the handle of the scroll bar control.
SB_HORZ Specifies that the window is a horizontal scroll bar.
SB_VERT Specifies that the window is a vertical scroll bar.
lpScrollInfoA pointer to aSCROLLINFO structure. See the Win32 SDK Programmer’s Reference for more information about this structure.bRedrawSpecifies whether the scroll bar should be redrawn to reflect the new position. If bRedraw is TRUE, the scroll bar is redrawn. If it is FALSE, it is not redrawn. The scroll bar is redrawn by default.
关于SCROLLINFO结构的含义如下:
typedef struct tagSCROLLINFO {
UINT cbSize;
UINT fMask;
int nMin;
int nMax;
UINT nPage;
int nPos;
int nTrackPos;
} SCROLLINFO, *LPSCROLLINFO;
typedef SCROLLINFO CONST *LPCSCROLLINFOcbSize
Specifies the size, in bytes, of this structure.
fMask
Specifies the scroll bar parameters to set or retrieve. This member can be a combination of the following values: Value Meaning
SIF_ALL Combination of SIF_PAGE, SIF_POS, SIF_RANGE, and SIF_TRACKPOS.
SIF_DISABLENOSCROLL This value is used only when setting a scroll bar's parameters. If the scroll bar's new parameters make the scroll bar unnecessary, disable the scroll bar instead of removing it.
SIF_PAGE The nPage member contains the page size for a proportional scroll bar.
SIF_POS The nPos member contains the scroll box position, which is not updated while the user drags the scroll box.
SIF_RANGE The nMin and nMax members contain the minimum and maximum values for the scrolling range.
SIF_TRACKPOS The nTrackPos member contains the current position of the scroll box while the user is dragging it. 各成员含义:
nMin
Specifies the minimum scrolling position.
nMax
Specifies the maximum scrolling position.
nPage
Specifies the page size. A scroll bar uses this value to determine the appropriate size of the proportional scroll box.
nPos
Specifies the position of the scroll box.
nTrackPos
Specifies the immediate position of a scroll box that the user is dragging. An application can retrieve this value while processing the SB_THUMBTRACK request code. An application cannot set the immediate scroll position; the SetScrollInfo function ignores this member. 你以为类向导是什么啊?
MSDN三个月更新一次,VC集成环境可不是呀,要帮助应该找专业的帮助.
类向导只不过给你提供一点小小小小小的方便而已....
解决方案 »
- DATETIMEPICKER问题???
- vc6.0做的DLL,能否控制该DLL只能在指定的工程中运行??????????????????????????????
- 很奇怪的一个非法内存访问
- DECLARE_MESSAGE_MAP()请问这个是什么?为什么调用此方法后可以不加;
- 问一个关于“CriticalSetion”等线程数据交换的问题
- 在ActiveX控件上如何放置基本控件如"按钮"
- 金山词霸那样的界面如何做
- (急!)用ODBC调试远程数据库出现如下错误,请哪位高手指点?
- 准备跳槽!!!想参加个培训。
- 请看我这程序的错误是内存不足的原因么?
- 用ATL做控件,怎么得到控件容器的RECT?
- 用何编程语言对视频信号(由串口)进行编程,请指教!
switch(消息类型)
{
case ...:
pWnd->DDDDD();
break;
...
}
的形式对它控制。