What MFC class should I base free floating views on

546 views Asked by At

I have a dialog based MFC application. Now I want to create a wiew (one or more) with a toolbar, scroll bars and a client window (based on CWnd).

What MFC class should I base this window on? What is the best way to do it?

Thanks.

2

There are 2 answers

0
Edward Clements On

Using a scrolling client window is more natural in a Document-View application than a dialog based application -- you can have menu bars and toolbars connected to a dialog, but to a View as far as I know.

A SDI application allows support for multiple docking/floating toolbars and multiple views of the same document, so this would be my advice...

2
ScottMcP-MVP On

Start with a CFrameWnd. It's job is to give your window a titlebar/close button etc., and position control bars (such as a toolbar) and a menu (if you want one) and a view within itself. The view should be a CScrollView (for painted graphics) or a CFormView (for dialog-like controls).

You will find this to be a lot easier if your just start from scratch and let the app wizard generate an SDI or MDI app to start with.