Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » How can i get the scrollbar on the resizable dialog bar.......... Collapse All
Subject Author Date
sanjay kadam Jun 4, 2007 - 4:57 AM

Hi Folks,

i am using one resizable dialog in the Reporgrid........
but i am not getting the scrollbar on the dialog box..........

so can anybody help me out.................

Ou Shanhu Oct 29, 2007 - 7:21 AM

If your time is availabe, would you do me a favor? Thanks!

Ou Shanhu Oct 23, 2007 - 9:05 AM

If your time is availabe, would you do me a favor? Thanks!

Ou Shanhu Oct 18, 2007 - 9:28 AM

Sorry, I am just a fresh man. It seems to be very difficult for me though you explained very explictly in detail.
I have four dialogs and would you kindly update the http://www.prof-uis.com/download/forums/TestScrollDialog.zip in order to meet my requirement? I think it is easy for you.

Thanks a lot.

Technical Support Oct 17, 2007 - 1:20 PM

We think now we understand your question really clear. You should not create both of your dialogs as children of one scrollable container. You should create two scrollable containers. Each of them would contain its own dialog. You could use one additional container window which keeps both scrollable containers and only one scrollable window will be visible at a moment. We do not think this is difficult.

Ou Shanhu Oct 17, 2007 - 10:48 AM

Would you kindly update the http://www.prof-uis.com/download/forums/TestScrollDialog.zip in order to meet my requirement?

Ou Shanhu Oct 17, 2007 - 9:04 AM

What is the problem?

Ou Shanhu Oct 16, 2007 - 6:07 AM

Perhaps I didn’t descript my question clearly.
I write an application based on the above example (http://www.prof-uis.com/download/forums/TestScrollDialog.zip), In this example, there is only one dialog, but in my application, there are two dialogs, I want to switch between them when I triggled it (select the menu or click one button in the toolbar etc.).
In the mainfrm.cpp, I create the two dialogs:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
......
if( ! m_wndScrollContainer.Create( NULL, NULL, WS_CHILD|WS_VISIBLE, rectDefault, this, AFX_IDW_PANE_FIRST ) )
{
ASSERT( FALSE );
return -1;
}

if( ! m_dlgTest1.Create( CTestDialog1::IDD, &m_wndScrollContainer ) )
{
ASSERT( FALSE );
return -1;
}

if( ! m_dlgTest2.Create( CTestDialog2::IDD, &m_wndScrollContainer ) )
{
ASSERT( FALSE );
return -1;
}

m_wndScrollContainer.OnSwRecalcLayout( TRUE );
......
}

Unfortually, only m_dlgTest1 can be resizable, m_dlgTest2 can not be resizable.

Why?

Technical Support Oct 16, 2007 - 5:05 AM

Here is the application that has the following layout:

CMainFrame -----contains-----> CExtScrollContainerWnd -----contains-----> a resizable dialog window

But in fact the CExtScrollContainerWnd window is the parent for three windows: a resizable dialog and two CExtScrollBar windows. You can find the same layout in several copies in your application. Here is how you can get pointers to the scroll bars:

CYourDialog * pDlg = . . .
CExtScrollContainerWnd * pScrollContainerWnd = (CExtScrollContainerWnd)pDlg->GetParent();
CExtScrollBar * pScrollBarH = (CExtScrollBar*)pScrollContainerWnd->GetScrollBarCtrl( SB_HORZ );
CExtScrollBar * pScrollBarV = (CExtScrollBar*)pScrollContainerWnd->GetScrollBarCtrl( SB_VERT );

Ou Shanhu Oct 15, 2007 - 4:30 AM

I create multiple dialogs based on the above sample, when I switch the dialogs, why only the first dialog can be resizable?
e.g.:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    ......
    if( ! m_wndScrollContainer.Create( NULL, NULL, WS_CHILD|WS_VISIBLE, rectDefault, this, AFX_IDW_PANE_FIRST ) )
    {
        ASSERT( FALSE );
        return -1;
    }

    if( ! m_dlgTest1.Create( CTestDialog1::IDD, &m_wndScrollContainer ) )
    {
        ASSERT( FALSE );
        return -1;
    }

    if( ! m_dlgTest2.Create( CTestDialog2::IDD, &m_wndScrollContainer ) )
    {
        ASSERT( FALSE );
        return -1;
    }

    m_wndScrollContainer.OnSwRecalcLayout( TRUE );
    ......
}

Technical Support Jun 5, 2007 - 10:41 AM

The CExtResizableDialog class is based on MFC’s CDialog rather than on MFC’s CFormView. That is why it does not support scrolling. If you need a scrollable dialog, you should use a scrollable container window which contains a dialog inside like in this sample.