How to add scroll bar in the child windows in MDI with Visual c++ 6.0

T

Timcool.huang

I tried to add scroll bar to the child window in a MDI.

In the mother window I modify code as below:
BOOL CMainFrame::preCreateWindow(CREATESTRUCT& cs)
{
cs.style =WS_OVERLAPPEDWINDOW|WS_VSCROLL|WS_HSCROLL;////Mewly added
if( !CMDIFrameWnd::preCreateWindow(cs) )
return FALSE;
return TRUE;
}
It works well.

However in the child windows.
BOOL CChildFrame::preCreateWindow(CREATESTRUCT& cs)
{
///////////Mewly added///////////////////////////
cs.style =WS_CHILD|WS_OVERLAPPEDWINDOW|WS_VSCROLL|WS_HSCROLL;
//////////////////////////////////////////////////////////////////////////
if( !CMDIChildWnd::preCreateWindow(cs) )
return FALSE;
return TRUE;
}

The scroll bar will appear when running the program, however it doesn't
function. I can't scroll the child window at all.

I also tried the method recommended by MSDN---- "derive a new class
from CMDIChildWnd and replace all references to CMDIChildWnd in your
project with references to the new class." The scroll bar wont even
come out. Where did I make mistake?

Anybody can help me with the simple question?
 
R

red floyd

I tried to add scroll bar to the child window in a MDI.
[Win32 API Question redacted]

What's a "scroll bar"? What's a "child window"? What's an "MDI"?
The ISO C++ Standard discusses none of these.

In other words, you're OT. May I suggest a newsgroup with "microsoft"
or "visual" in its name? A good starting point might be:

microsoft.public.vc.language
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top