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:reCreateWindow(CREATESTRUCT& cs)
{
cs.style =WS_OVERLAPPEDWINDOW|WS_VSCROLL|WS_HSCROLL;////Mewly added
if( !CMDIFrameWnd:reCreateWindow(cs) )
return FALSE;
return TRUE;
}
It works well.
However in the child windows.
BOOL CChildFrame:reCreateWindow(CREATESTRUCT& cs)
{
///////////Mewly added///////////////////////////
cs.style =WS_CHILD|WS_OVERLAPPEDWINDOW|WS_VSCROLL|WS_HSCROLL;
//////////////////////////////////////////////////////////////////////////
if( !CMDIChildWnd:reCreateWindow(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?
In the mother window I modify code as below:
BOOL CMainFrame:reCreateWindow(CREATESTRUCT& cs)
{
cs.style =WS_OVERLAPPEDWINDOW|WS_VSCROLL|WS_HSCROLL;////Mewly added
if( !CMDIFrameWnd:reCreateWindow(cs) )
return FALSE;
return TRUE;
}
It works well.
However in the child windows.
BOOL CChildFrame:reCreateWindow(CREATESTRUCT& cs)
{
///////////Mewly added///////////////////////////
cs.style =WS_CHILD|WS_OVERLAPPEDWINDOW|WS_VSCROLL|WS_HSCROLL;
//////////////////////////////////////////////////////////////////////////
if( !CMDIChildWnd:reCreateWindow(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?