How can I know if scrollbar appears ?
-
Hello . I have an MDI application with CView based on CScrollView and somewhere , in OnMouseMove handler I have :
if(pView->GetStyle() & WS\_HSCROLL)TRACE("\\n WS\_HSCROLL \\n"); if(pView->GetStyle() & WS\_VSCROLL)TRACE("\\n WS\_VSCROLL \\n");
without any effect ... either scrollbar appear or not , I haven't anything ... how can I know for sure of scrollbar appear or not ? Thanks !
-
Hello . I have an MDI application with CView based on CScrollView and somewhere , in OnMouseMove handler I have :
if(pView->GetStyle() & WS\_HSCROLL)TRACE("\\n WS\_HSCROLL \\n"); if(pView->GetStyle() & WS\_VSCROLL)TRACE("\\n WS\_VSCROLL \\n");
without any effect ... either scrollbar appear or not , I haven't anything ... how can I know for sure of scrollbar appear or not ? Thanks !
Have you called SetScrollSizes()[^] in your OnInitialUpdate() method?
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
-
Hello . I have an MDI application with CView based on CScrollView and somewhere , in OnMouseMove handler I have :
if(pView->GetStyle() & WS\_HSCROLL)TRACE("\\n WS\_HSCROLL \\n"); if(pView->GetStyle() & WS\_VSCROLL)TRACE("\\n WS\_VSCROLL \\n");
without any effect ... either scrollbar appear or not , I haven't anything ... how can I know for sure of scrollbar appear or not ? Thanks !
Can GetScrollBarInfo[^] give you the required information?
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <
-
Have you called SetScrollSizes()[^] in your OnInitialUpdate() method?
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
Yes , everything it's allright there ... sometime scrollbar appear , sometime not ... I mean , if the window is reduced , scrollbar appear , if window is increased , scrollbar dissapear .
-
Can GetScrollBarInfo[^] give you the required information?
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <
I didn't use GetScrollBarInfo by now ... I don't know how ... I will try and let you know if I did it .
-
I didn't use GetScrollBarInfo by now ... I don't know how ... I will try and let you know if I did it .
All right, good luck, if you get stuck somewhere, tell me/us and we'll see if i/we can help.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <
-
Yes , everything it's allright there ... sometime scrollbar appear , sometime not ... I mean , if the window is reduced , scrollbar appear , if window is increased , scrollbar dissapear .
That sounds like correct behaviour. The scrollbar should only appear when the amount of data to display is larger than the client area of the window, either horizontally, vertically, or both. Are you sure that you are recalculating your scroll sizes correctly when the window size changes?
Just say 'NO' to evaluated arguments for diadic functions! Ash
-
That sounds like correct behaviour. The scrollbar should only appear when the amount of data to display is larger than the client area of the window, either horizontally, vertically, or both. Are you sure that you are recalculating your scroll sizes correctly when the window size changes?
Just say 'NO' to evaluated arguments for diadic functions! Ash
Yes , I'm sure . Still , I can't solve the problem ... I see that VC2005 have CheckScrollBars(...) method , but I work in VC6 ... :doh:
-
All right, good luck, if you get stuck somewhere, tell me/us and we'll see if i/we can help.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <
I solve the problem in that way : I write myself CheckScrollBars(...) method :
void CMyView::CheckScrollBars(BOOL& bHasHorzBar, BOOL& bHasVertBar) const
{
DWORD dwStyle = GetStyle();CScrollBar\* pBar = GetScrollBarCtrl(SB\_VERT); bHasVertBar = ((pBar != NULL) && pBar->IsWindowEnabled()) || (dwStyle & WS\_VSCROLL); pBar = GetScrollBarCtrl(SB\_HORZ); bHasHorzBar = ((pBar != NULL) && pBar->IsWindowEnabled()) || (dwStyle & WS\_HSCROLL);
}
-
I solve the problem in that way : I write myself CheckScrollBars(...) method :
void CMyView::CheckScrollBars(BOOL& bHasHorzBar, BOOL& bHasVertBar) const
{
DWORD dwStyle = GetStyle();CScrollBar\* pBar = GetScrollBarCtrl(SB\_VERT); bHasVertBar = ((pBar != NULL) && pBar->IsWindowEnabled()) || (dwStyle & WS\_VSCROLL); pBar = GetScrollBarCtrl(SB\_HORZ); bHasHorzBar = ((pBar != NULL) && pBar->IsWindowEnabled()) || (dwStyle & WS\_HSCROLL);
}
If it works for you, then :thumbsup:, thanks for sharing your solution. :)
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <