我有一个多行的Edit 控件,设置了垂直滚动条风格,当控件里的内容没有一个屏幕大的时候,垂直滚动条是 Disenable 状态,当内容多余一个屏幕的时候是 Enable状态。问题是,当Edit控件里的内容小于一个屏幕的时候,如何让垂直滚动条消失,当内容大于一个屏幕的时候,垂直滚动条出现

解决方案 »

  1.   

    我也碰到类似的问题,我想这里的问题是不是有什么办法可以获的editbox中scrollbar的控制,这个scrollbar应该被封装了,所以现在看不见了。期盼高手指教。下面是我得问题:http://community.csdn.net/Expert/TopicView.asp?id=5624118
      

  2.   

    想个办法得到ScrollBar的窗口指针,然后ShowWindow(FALSE);需要的时候再TRUE。帮你找到了
    CWnd::GetScrollBarCtrl  
    virtual CScrollBar* GetScrollBarCtrl( int nBar ) const;
      

  3.   

    加一句,用CYouEdit.GetScrollBarCtrl(HorV)就行了;Return ValueA sibling scroll-bar control, or NULL if none.ParametersnBarSpecifies the type of scroll bar. The parameter can take one of the following values: SB_HORZ   Retrieves the position of the horizontal scroll bar.
    SB_VERT   Retrieves the position of the vertical scroll bar.