Scrolling issues in modeless dialog 
Author Message
 Scrolling issues in modeless dialog

Hi guys ...

I'm working on a program that uses a modeless dialog to displays some
graphics,
along with a graph plotted on the CView area. I need a vertical scroll bar
on the dialog,
so that I can use it scroll through the graphics displayed on the client
area.
What code should I use to get this effect?

I used something like this:

//
// My code
//

void CMyDialogDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar*
pScrollBar)
{
         // TODO: Add your message handler code here and/or call default
         int nScrollPos;  // Scoll position
         int nDir;  // Up or down/

         nScrollPos = GetScrollPos (SB_VERT);

         switch (nSBCode)
         {
             case SB_PAGEDOWN:
                  nScrollPos -= 15;
                  nDir = -1;
                  break;
             case SB_PAGEUP:
                  nScrollPos += 15;
                  nDir = 1;
                  break;
             case SB_LINEDOWN:
                  nScrollPos += 1;
                  nDir = -1;
                  break;
             case SB_LINEUP:
                  nScrollPos -= 1;
                  nDir = 1;
                  break;
             case SB_THUMBTRACK:
                  nScrollPos = nPos;
                  break;
                 default:
                  break;
             }

     SetScrollPos (SB_VERT, nScrollPos);
     ScrollWindow (0, nDir*nScrollPos);
     UpdateWindow ();

 CDialog::OnVScroll(nSBCode, nPos, pScrollBar);

Quote:
}

//
// My code
//

Where have I gone wrong? Please help me out.

Thanks in advance ...



Sun, 06 Apr 2003 07:20:18 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Scrolling issues in modeless dialogs

2. modal and modeless dialog, parent and owner issues

3. Modeless dialog and z-order/focus issue

4. Scrolling issues in modelss dialogs

5. create a scroll view within a modeless dialog

6. create a scroll view within a modeless dialog

7. Modeless dialog shall not be modeless !

8. Q: tabbing not possible in modeless propertysheet / modeless dialog

9. Modeless property sheet in a modeless dialog box

10. CListBox - horizontal scroll bar issue

11. Modeless dialog in a dialog-based app

12. Accessing a parent dialog's controls from a child modeless dialog

 

 
Powered by phpBB® Forum Software