Scroll Dialog window 
Author Message
 Scroll Dialog window

Hi,
    I 'm trying to have a dialog window scroll.

The following is the code under the OnVScroll message of the dialog class:

// These can be tweaked to better fit the implementation
    int nInc;
    switch (nSBCode)
    {
        case SB_TOP:        nInc = -m_nVscrollPos;               break;
        case SB_BOTTOM:     nInc = m_nVscrollMax-m_nVscrollPos;  break;
        case SB_LINEUP:     nInc = -1;                           break;
        case SB_LINEDOWN:   nInc = 1;                            break;
        case SB_PAGEUP:     nInc = min(-1, -m_nVertInc);         break;
        case SB_PAGEDOWN:   nInc = max(1, m_nVertInc);           break;
        case SB_THUMBTRACK: nInc = nPos - m_nVscrollPos;         break;
        default:            nInc = 0;
    }

    nInc = max(-m_nVscrollPos, min(nInc, m_nVscrollMax - m_nVscrollPos));

    if (nInc)
    {
        m_nVscrollPos += nInc;
        int iMove = -VERT_PTS * nInc;
        ScrollWindow(0, iMove, NULL, NULL);
        SetScrollPos(SB_VERT, m_nVscrollPos, TRUE);
  Invalidate();
    }

where VERT_PTS = 4.

The scroll bar moves accordingly but the window does not.

Any ideas?

Thanks,
    Jonathan



Sat, 30 Apr 2005 05:22:35 GMT  
 Scroll Dialog window

Hi,
try this

ScrollWindowEx(0,
iMove,NULL,NULL,NULL,NULL,SW_SCROLLCHILDREN );
//this one worked for me

cheers
Ramesh

Quote:
>-----Original Message-----
>Hi,
>    I 'm trying to have a dialog window scroll.

>The following is the code under the OnVScroll message of
the dialog class:

>// These can be tweaked to better fit the implementation
>    int nInc;
>    switch (nSBCode)
>    {
>        case SB_TOP:        nInc = -

m_nVscrollPos;               break;
Quote:
>        case SB_BOTTOM:     nInc = m_nVscrollMax-

m_nVscrollPos;  break;
Quote:
>        case SB_LINEUP:     nInc = -

1;                           break;
Quote:
>        case SB_LINEDOWN:   nInc =

1;                            break;
Quote:
>        case SB_PAGEUP:     nInc = min(-1, -

m_nVertInc);         break;
Quote:
>        case SB_PAGEDOWN:   nInc = max(1,

m_nVertInc);           break;
Quote:
>        case SB_THUMBTRACK: nInc = nPos -

m_nVscrollPos;         break;
Quote:
>        default:            nInc = 0;
>    }

>    nInc = max(-m_nVscrollPos, min(nInc, m_nVscrollMax -
m_nVscrollPos));

>    if (nInc)
>    {
>        m_nVscrollPos += nInc;
>        int iMove = -VERT_PTS * nInc;
>        ScrollWindow(0, iMove, NULL, NULL);
>        SetScrollPos(SB_VERT, m_nVscrollPos, TRUE);
>  Invalidate();
>    }

>where VERT_PTS = 4.

>The scroll bar moves accordingly but the window does not.

>Any ideas?

>Thanks,
>    Jonathan

>.



Sat, 07 May 2005 07:40:56 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. main dialog window is blocked by second dialog window

2. Scrolling issues in modeless dialog

3. Scrolling in a Dialog

4. ????? dialog - scrolling ??????????????????

5. Scrolling in a dialog

6. a Scroll 'n' zoom in Dialog

7. Scrolling problems with CEdit - Multiline on a dialog

8. Dynamic Dialog Controls/Scrolling -- MSVC1.52

9. Scrolling for a Dialog?

10. scroll bar using dialog

11. Programmatically scroll CEdit in a dialog?

12. Drawing in dialog Box and scroll problem

 

 
Powered by phpBB® Forum Software