Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

how to creat a scrollbar in mode SDI ???

nhocgrubynhocgruby Posts: 4Member
I have an application MFC Wizard (exe) in mode SDI , I want to creat a scrollbar in my program . Can you help me step by step ? Thank you very much .

Comments

  • AsmGuru62AsmGuru62 Posts: 6,519Member
    : I have an application MFC Wizard (exe) in mode SDI , I want to creat
    : a scrollbar in my program . Can you help me step by step ? Thank you
    : very much .
    :
    [color=Blue]When you create your CView-based class specify WS_VSCROLL style and that should do it.[/color]
  • nhocgrubynhocgruby Posts: 4Member
    : : I have an application MFC Wizard (exe) in mode SDI , I want to creat
    : : a scrollbar in my program . Can you help me step by step ? Thank you
    : : very much .
    : :
    : [color=Blue]When you create your CView-based class specify
    : WS_VSCROLL style and that should do it.[/color]

    I don't understand . Can you help me again?

    I have an application ( SDI ) like the Wordpad Window Program, and when i touch many words , i can not see all them because i have not a scrollbar . It is my problem .


  • AsmGuru62AsmGuru62 Posts: 6,519Member
    : : : I have an application MFC Wizard (exe) in mode SDI , I want to creat
    : : : a scrollbar in my program . Can you help me step by step ? Thank you
    : : : very much .
    : : :
    : : [color=Blue]When you create your CView-based class specify
    : : WS_VSCROLL style and that should do it.[/color]
    :
    : I don't understand . Can you help me again?
    :
    : I have an application ( SDI ) like the Wordpad Window Program, and
    : when i touch many words , i can not see all them because i have not
    : a scrollbar . It is my problem .
    :
    :
    :
    [color=Blue]
    Find this code in your MFC application and add a scroll bar style (RED):
    [/color]
    [code]
    int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
    {
    if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
    return -1;

    // create a view to occupy the client area of the frame
    if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW | [color=Red]WS_VSCROLL[/color],
    CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
    {
    TRACE0("Failed to create view window
    ");
    return -1;
    }
    return 0;
    }
    [/code]
    [color=Blue]
    Now, add the scrolling handler to your CView-based window:
    [code]
    void CChildView::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
    {
    }
    [/code]
    [/color]
  • nhocgrubynhocgruby Posts: 4Member
    : : : : I have an application MFC Wizard (exe) in mode SDI , I want to creat
    : : : : a scrollbar in my program . Can you help me step by step ? Thank you
    : : : : very much .
    : : : :
    : : : [color=Blue]When you create your CView-based class specify
    : : : WS_VSCROLL style and that should do it.[/color]
    : :
    : : I don't understand . Can you help me again?
    : :
    : : I have an application ( SDI ) like the Wordpad Window Program, and
    : : when i touch many words , i can not see all them because i have not
    : : a scrollbar . It is my problem .
    : :
    : :
    : :
    : [color=Blue]
    : Find this code in your MFC application and add a scroll bar style
    : (RED):
    : [/color]
    : [code]:
    : int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
    : {
    : if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
    : return -1;
    :
    : // create a view to occupy the client area of the frame
    : if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW | [color=Red]WS_VSCROLL[/color],
    : CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
    : {
    : TRACE0("Failed to create view window
    ");
    : return -1;
    : }
    : return 0;
    : }
    : [/code]:
    : [color=Blue]
    : Now, add the scrolling handler to your CView-based window:
    : [code]:
    : void CChildView::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
    : {
    : }
    : [/code]:
    : [/color]


    In my file mainframe , i only see some code :

    [code]int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
    {
    if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
    return -1;

    if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
    | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
    !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
    {
    TRACE0("Failed to create toolbar
    ");
    return -1; // fail to create
    }

    if (!m_wndStatusBar.Create(this) ||
    !m_wndStatusBar.SetIndicators(indicators,
    sizeof(indicators)/sizeof(UINT)))
    {
    TRACE0("Failed to create status bar
    ");
    return -1; // fail to create
    }

    // TODO: Delete these three lines if you don't want the toolbar to
    // be dockable
    m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
    EnableDocking(CBRS_ALIGN_ANY);
    DockControlBar(&m_wndToolBar);

    return 0;
    }
    [/code]

    I dont see things you talk to me ???

Sign In or Register to comment.