快疯了,怎么改变scrollbar的外观

artmouse 2005-05-21 05:39:11
想改变颜色,并改成平面那种,看了n多帖子,就是不明白,有什么办法简单一点的.
...全文
175 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xyw2278 2005-05-23
  • 打赏
  • 举报
回复
//我是用在ScrollView中的, 改是改了,但有点不正常,估计还得处理OnHScroll和OnVScroll消息:

HWND hWnd = this->GetSafeHwnd();
if(::InitializeFlatSB(hWnd))
{
::FlatSB_SetScrollProp(hWnd, WSB_PROP_HBKGCOLOR, RGB(0,0,255),TRUE);
::FlatSB_SetScrollProp(hWnd, WSB_PROP_VBKGCOLOR, RGB(255,0,255),TRUE);

::FlatSB_SetScrollProp(hWnd, WSB_PROP_HSTYLE, FSB_FLAT_MODE,TRUE);
::FlatSB_SetScrollProp(hWnd, WSB_PROP_VSTYLE, FSB_REGULAR_MODE,TRUE);
}
artmouse 2005-05-21
  • 打赏
  • 举报
回复
有人用InitializeFlatSB成功过嘛?
OnlyHappy 2005-05-21
  • 打赏
  • 举报
回复
Enables or disables one or both flat scroll bar direction buttons. If flat scroll bars are not initialized for the window, this function calls the standard EnableScrollBar API.

Syntax

BOOL FlatSB_EnableScrollBar( HWND hwnd,
int wSBflags,
UINT wArrows
);
Parameters

hwnd
Handle to the window that contains the flat scroll bar. This window handle must have been passed previously in a call to InitializeFlatSB.
wSBflags
Parameter that specifies the scroll bar type. It can be one of the following values:
SB_BOTH
Enables or disables the direction buttons on the horizontal and vertical scroll bars.
SB_HORZ
Enables or disables the direction buttons on the horizontal scroll bar.
SB_VERT
Enables or disables the direction buttons on the vertical scroll bar.
wArrows
Parameter that specifies whether the scroll bar arrows are enabled or disabled and indicates which arrows are enabled or disabled. It can be one of the following values:
ESB_DISABLE_BOTH
Disables both direction buttons on the specified scroll bar.
ESB_DISABLE_DOWN
Disables the down direction button on the vertical scroll bar.
ESB_DISABLE_LEFT
Disables the left direction button on the horizontal scroll bar.
ESB_DISABLE_LTUP
Disables the left direction button on the horizontal scroll bar or the up direction button on the vertical scroll bar.
ESB_DISABLE_RIGHT
Disables the right direction button on the horizontal scroll bar.
ESB_DISABLE_RTDN
Disables the right direction button on the horizontal scroll bar or the down direction button on the vertical scroll bar.
ESB_DISABLE_UP
Disables the up direction button on the vertical scroll bar.
ESB_ENABLE_BOTH
Enables both direction buttons on the specified scroll bar.
Return Value

Returns nonzero if the scroll bar changes, or zero otherwise.



Remarks

Note Flat scroll bar APIs are implemented in Comctl32.dll versions 4.71 through 5.82. Comctl32.dll versions 6.00 and higher do not support flat scroll bars.
Function Information

Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Import library comctl32.lib
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0


--------------------------------------------------------------------------------

© 2003 Microsoft Corporation. All rights reserved.

16,548

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧