User
User

Reputation: 65931

MFC: How to create options dialog with listbox and multiple pages?

Developing using Visual Studio 2010 C++ and MFC. I want to create an options (preferences/settings) dialog box that can display several options. After considering many different options dialog box UIs I think I like the listbox-with-multiple-pages-style similar to visual studio's option dialog box (but I don't need the treeview, a list box is fine).

What's a good way to implement this? Do I use a CListBox and then handle the selection event to load up the individual pages? I'm new to MFC, what would the individual pages even be? Something like a panel? Ideally I would design them in the resource editor and then be able to load them up.

Upvotes: 1

Views: 2378

Answers (2)

Olivier Hélin
Olivier Hélin

Reputation: 54

See CPropertySheet and CPropertyPage classes. This allows you to easily manage a properties window with several views.

Upvotes: 0

Monobounce
Monobounce

Reputation: 108

Take a look at http://www.codeproject.com/KB/dialog/embedded_dialog.aspx for one possible way of doing this.

The individual property pages can be designed as dialogs in the resource editor, and then the relevant page can be displayed in your main dialog depending on the selection in the list box, by handling the LVN_ITEMCHANGED message.

Upvotes: 2

Related Questions