The following is a set of guideline on how one can make Wizards using Dialog Boxes in Pocket PC
1. Create a class/ struct that would contain all the data that you need from the wizard. Use this to set the fields of wizard on different pages and to remember the user settings from the wizard pages when they are destroyed (when user presses "Back")
2. You will need to create a dialog for each page of the wizard. The menubar of these dialogs should have "Back" and "Next" buttons. The last dialog should have a "Finish" button instead of "Next". Similarly the first page should have a "Cancel" button istead of "Next"
3. When "Next" is pressed, create another dialog (next wizard page) on top of the existing one. There is no need to either destroy or hide the previous page. You can simply make the next page a child of the previous page and it will always be painted on its top.
4. When "Back" is pressed, simply destroy the current page.
5. When "Finish" is pressed, destroy all the pages starting with the topmost.
6. Return unique IDs for "Finish”, “Back” and “Cancel” softkeys. When the user hits “Finish” on the last page, this page returns this ID to its parent. The parent sees that the return ID is “Finish” and not “Back” , so it closes itself and returns the same ID. This was the gets propagated till the end from where the first dialog is created.When a “Back” ID is returned by a wizard page, the parent will not destroy itself.
7. When the user presses “Back”, save the data of the page that is being destroyed into the common class (so that the user settings are remembered for each page). When the page is created again by pressing “Next” in the previous page, populate the fields of this page from this class. Disclaimer : This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
Disclaimer : This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm