Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 16th, 2003, 03:31 AM
Authorized User
Join Date: Jun 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default How can I make two scroll bar to be the same one?

I am developing a MDI program, and I meet a trouble now. Who can help me?

I hope to make an editor, which contain a split-able scroll bar such as VC dev., UltraEdit etc.

it can split dynamic. So I create a split window in ChildFrame.

BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
//TODO: Add your specialized code here and/or call the base class

  return m_wndSplitter.Create(this, 2, 2, CSize(30, 30), pContext);

   In my view class, I use a third part Editor control. This control will create a vertical scroll bar when the text is over it length, so it will appear two scroll bars on the left of the view. How can I make it be same one? Thanks!

I had try to do following test, but both are fail.
  1) m_wndSplitter.SetScrollStyle(0); // the m_wndSplitter's csroll bar is dispear, but it can't split.

  2) m_wndSplitter.CreateScrollBarCtrl( WS_VSCROLL,AFX_IDW_PANE_FIRST);

My Email is [email protected]
Any help would be greatly appreciated.
Old September 16th, 2003, 09:28 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma

You can devide your childframe into two rows and
two columns and then create the views for each
of these four panes like this

    if (!m_wndSplitter.CreateStatic(this,2,2))
        return FALSE;

    if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CSplitterScrollView), CSize(100, 100), pContext) ||
        !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CSplitterScrollView), CSize(100, 100), pContext) ||
        !m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CSplitterScrollView), CSize(100, 100), pContext) ||
        !m_wndSplitter.CreateView(1, 1, RUNTIME_CLASS(CSplitterScrollView), CSize(100, 100), pContext))
        return FALSE;

    return TRUE;

This way you will get rid of the extra frame
scroll bar but all these four panes will be
independent and you will have to write
code to keep them in harmony.

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Scroll bar in IE not working BobbyFisher CSS Cascading Style Sheets 2 April 18th, 2005 05:34 PM
How to control scroll bar BurhanKhan Javascript 3 August 26th, 2004 02:31 PM
css and scroll bar markhardiman HTML Code Clinic 3 July 18th, 2003 04:55 AM
Scroll Bar cooldude87801 BOOK: Beginning Java 2 0 June 18th, 2003 11:59 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.