Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 16th, 2003, 03:31 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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 chenzhidan@goldenchip.com.cn
Any help would be greatly appreciated.
Reply With Quote
  #2 (permalink)  
Old September 16th, 2003, 09:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
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
Default

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))
    {
        m_wndSplitter.DestroyWindow();
        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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:09 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.