如何使listview 的scrollbar隐藏
2个回答
展开全部
不好意思,没有办法实现,除非类似XPMenu那样使用窗口子类化,真没找到办法实现
void TCustomListView::ResetExStyles(void)
{
DWORD Styles;
TCustomImageList *TempImages;
if (HandleAllocated())
{
TempImages = NULL;
if (StateImages )
{
TempImages = StateImages;
StateImages = NULL;
}
Styles = LVS_EX_SUBITEMIMAGES | LVS_EX_INFOTIP;
if (FCheckboxes) Styles = LVS_EX_CHECKBOXES;//其实这里应该是Styles|=LVS_EX_CHECKBOXES
if (FGridLines) Styles = Styles | LVS_EX_GRIDLINES;
if (FHotTrack ) Styles = Styles | LVS_EX_TRACKSELECT;
if (FRowSelect) Styles = Styles | LVS_EX_FULLROWSELECT;
if (FFlatScrollBars) Styles = Styles | LVS_EX_FLATSB;
if (FFullDrag) Styles = Styles | LVS_EX_HEADERDRAGDROP;
if (FShowWorkAreas) Styles = Styles | LVS_EX_MULTIWORKAREAS;
if (FHotTrackStyles.Contains(htHandPoint))
Styles = Styles | LVS_EX_ONECLICKACTIVATE
else //if (FHotTrackStyles * [htUnderlineHot, htUnderlineCold] <> [] then
//Delphi代码不知如下转换对否,还望指点
if(FHotTrackStyles.Contains(htUnderlineHot)||FHotTrackStyles.Contains(htUnderlineCold)
Styles = Styles | LVS_EX_TWOCLICKACTIVATE;
if (FHotTrackStyles.Contains(htUnderlineHot)) then
Styles = Styles | LVS_EX_UNDERLINEHOT;
if (FHotTrackStyles.Contains(htUnderlineCold)) then
Styles = Styles | LVS_EX_UNDERLINECOLD;
ListView_SetExtendedListViewStyle(Handle, Styles);
if (TempImages )
StateImages = TempImages;
}
}
-------------------------------------------
从这段代码上看就算是使用如下代码设置了ScrollBar隐藏也还是没用。
void TCustomListView::ResetExStyles(void)
{
DWORD Styles;
TCustomImageList *TempImages;
if (HandleAllocated())
{
TempImages = NULL;
if (StateImages )
{
TempImages = StateImages;
StateImages = NULL;
}
Styles = LVS_EX_SUBITEMIMAGES | LVS_EX_INFOTIP;
if (FCheckboxes) Styles = LVS_EX_CHECKBOXES;//其实这里应该是Styles|=LVS_EX_CHECKBOXES
if (FGridLines) Styles = Styles | LVS_EX_GRIDLINES;
if (FHotTrack ) Styles = Styles | LVS_EX_TRACKSELECT;
if (FRowSelect) Styles = Styles | LVS_EX_FULLROWSELECT;
if (FFlatScrollBars) Styles = Styles | LVS_EX_FLATSB;
if (FFullDrag) Styles = Styles | LVS_EX_HEADERDRAGDROP;
if (FShowWorkAreas) Styles = Styles | LVS_EX_MULTIWORKAREAS;
if (FHotTrackStyles.Contains(htHandPoint))
Styles = Styles | LVS_EX_ONECLICKACTIVATE
else //if (FHotTrackStyles * [htUnderlineHot, htUnderlineCold] <> [] then
//Delphi代码不知如下转换对否,还望指点
if(FHotTrackStyles.Contains(htUnderlineHot)||FHotTrackStyles.Contains(htUnderlineCold)
Styles = Styles | LVS_EX_TWOCLICKACTIVATE;
if (FHotTrackStyles.Contains(htUnderlineHot)) then
Styles = Styles | LVS_EX_UNDERLINEHOT;
if (FHotTrackStyles.Contains(htUnderlineCold)) then
Styles = Styles | LVS_EX_UNDERLINECOLD;
ListView_SetExtendedListViewStyle(Handle, Styles);
if (TempImages )
StateImages = TempImages;
}
}
-------------------------------------------
从这段代码上看就算是使用如下代码设置了ScrollBar隐藏也还是没用。
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询