Bonjir 2022-06-24 10:19 采纳率: 71.4%
浏览 11
已结题

vc怎样创造一个有垂直滚动条的ListBox?

img

如图,网上说行数够多就会自动出现滚动条,为什么100行的ListBox还是没有滚动条呢?

  • 写回答

1条回答 默认 最新

  • 赵4老师 2022-06-24 14:18
    关注

    WS_VSCROLL and WS_HSCROLL
    When either or both of these styles are specified for a list box, scroll bars are created for the list box.

    A vertical scroll bar is displayed when there are more items in a list box without the LBS_MULTICOLUMN style than can be displayed at one time. Without a scroll style (WS_VSCROLL or WS_HSCROLL), the list box will not display a vertical scroll bar, although the list box still scrolls when the user uses the mouse or keyboard. List boxes with the LBS_MULTICOLUMN style cannot scroll vertically, so no vertical scroll bar is displayed.

    A horizontal scroll bar is used by a list box on these occasions:

    When the list box has the LBS_MULTICOLUMN style, and there are more items than can be displayed at one time, the list box scrolls the columns horizontally. If the list box does not have the WS_HSCROLL or WS_VSCROLL style, the user can scroll the list box horizontally only by using the keyboard. A horizontal scroll bar is required to allow the user to scroll an LBS_MULTICOLUMN list box with a mouse.

    When a list box does not have the LBS_MULTICOLUMN style and the list box client window is narrower than the horizontal extent of the list box, a horizontal scroll bar is needed to scroll through the entire horizontal extent. The application must set the horizontal extent of the list box by sending the list box an LB_SETHORIZONTALEXTENT message. Without the horizontal extent set by the application, no horizontal scroll bar is displayed. See the "Considerations for Horizontal Scroll Bars in List Boxes" article in the MSDN Library for a complete discussion of horizontal scroll bars on list boxes.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 7月2日
  • 已采纳回答 6月24日
  • 创建了问题 6月24日

悬赏问题

  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮