Drawing in dialog Box and scroll problem 
Author Message
 Drawing in dialog Box and scroll problem

Hi all,

To draw in dialog Box, I use a generic CWnd.
I have used a CStatic to get the coordinates of the window I create.
I create the desired window in OnInitDialog like this :

CreateEx(dwExStyle, m_lpszClassName, _T(""), dwStyle,
                rect.left, rect.top, rect.right - rect.left , rect.bottom - rect.top,
                pParentWnd->GetSafeHwnd(), NULL, NULL );

with dwStyle = WS_VISIBLE|WS_CHILD|WS_BORDER|WS_HSCROLL|WS_VSCROLL

The problem is : when I use the scroll bar it does nothing.
What is wrong ?
Do you know where can I find some code samples ?

Thanks



Sun, 30 Jan 2005 09:36:21 GMT  
 Drawing in dialog Box and scroll problem

Quote:

> Hi all,

> To draw in dialog Box, I use a generic CWnd.
> I have used a CStatic to get the coordinates of the window I create.
> I create the desired window in OnInitDialog like this :

> CreateEx(dwExStyle, m_lpszClassName, _T(""), dwStyle,
>                 rect.left, rect.top, rect.right - rect.left , rect.bottom - rect.top,
>                 pParentWnd->GetSafeHwnd(), NULL, NULL );

> with dwStyle = WS_VISIBLE|WS_CHILD|WS_BORDER|WS_HSCROLL|WS_VSCROLL

> The problem is : when I use the scroll bar it does nothing.
> What is wrong ?
> Do you know where can I find some code samples ?

> Thanks

The only thing a scroll bar does is send you WM_HSCROLL/WM_VSCROLL.
Then you must write code to set its position & range and paint your
window accordingly.  I.e. it doesn't scroll your window, it just tells
you how to paint the appearance of scrolling.  The article "About Scroll
Bars" in MSDN describes the basics.

If you use CScrollView instead of a CWnd it handles most scrolling
issues for you.

--
Scott McPhillips [VC++ MVP]



Sun, 30 Jan 2005 12:32:01 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Dialog box RE-DRAWING problems?

2. How to scroll horizontally ,owner draw list box?

3. Newbie to owner drawn: Scroll Bars in Owner drawn ListCtrl

4. Scrolling a Dialog box

5. Dialog box w/ Vertical Scroll

6. scrolling a dialog box

7. How do I scroll dialog box

8. Vertcal scroll bar of a dialog box

9. Scrolling Dialog Box

10. Dialog Read-Only Edit Box and Scrolling

11. Adding scroll bar in dialog box

12. Scroll Bar in a dialog box

 

 
Powered by phpBB® Forum Software