StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Dynamically insert wizard pages at runtimeExpand / Collapse
Author
Message
Posted 08/10/2006 4:48:28 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: Today @ 5:33:29 PM
Posts: 80, Visits: 321
I'm trying to create a prototype for an application we're designing. I'm thinking of using the Wizardcontrol heavily. However, there will be a lot of need for conditionally/dynamically inserting/removing pages based on previous wizard steps. Can you give me a quick tutorial on this? I looked at the SampleWizard form in the UIControlsSample download and I saw this capability mentioned but could not find an example. Thanks in advance.

- Randy
Post #2151
Posted 08/10/2006 9:48:40 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 5:44:29 PM
Posts: 4,366, Visits: 4,393
Randy,

There are a lot of things that can be done with the Wizard control and it is designed to make adding pages and inserting pages very easy, both within the designer and at run-time.  The first thing you need to learn about is the control designer (shown in the image below).

This is opened using the little arrow at the top right of the control when selected.  In addition to creating a page on a form, you can create a page class which can then be added by selecting the "Existing Page" option.  To create a classable page, create a new item through the solution explorer and choose the SF Wizard Page template.

There are a number of functions on a wizard control to change the state of buttons and dynamically insert pages.  The first thing to learn about is the PageCollection property which houses all of the pages.  You can programmatically Add, Remove, and Insert pages.  This is just a collection and has all features as such.

Me.WizardControl1.PageCollection.Add(MyPage)
Me.WizardControl1.PageCollection.Insert(2, MyPage)

There are other methods to control the button states programmatically.

Me.WizardControl1.SetNavigationButtonStatus(WizardNavigationButtons.Next,WizardNavigationButtonStatus.Enabled)

In addition to all of the methods and properties that can be set, there are events on both a page and on the wizard control itself.

Page Events

  • BackClicked
  • NextClicked
  • PageActivated

Wizard Control Events

  • BackClicked
  • CancelClicked
  • NextClicked
  • FinishClicked
  • NextClicked
  • PageActivated

This is just a basic overview.  But the best thing is to create a project and play with the properties and page settings.  There is also a sample in the Samples and Solutions section of the forum that has a wizard example within it.  It is the UI Control sample. http://forum.strataframe.net/Topic1988-17-1.aspx

Hope this gets you started.  Let me know if you have more questions.

Post #2155
Posted 08/11/2006 10:19:18 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: Today @ 5:33:29 PM
Posts: 80, Visits: 321
Thanks. Yeah, this is a powerful set of classes. Bet you guys had fun creating this
Post #2157
Posted 08/11/2006 2:17:54 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: Today @ 5:33:29 PM
Posts: 80, Visits: 321
Trent L. Taylor (08/10/2006)
To create a classable page, create a new item through the solution explorer and choose the SF Wizard Page template.


When I try this I get "Object Reference Not set to an instance of an object" when I try to view in the visual designer.
Post #2161
Posted 08/11/2006 3:49:34 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 08/01/2008 8:53:41 AM
Posts: 2,671, Visits: 1,879
Thanks for the heads up... I'll check it out.


www.bungie.net
Post #2164
Posted 08/11/2006 5:00:37 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: Today @ 5:33:29 PM
Posts: 80, Visits: 321
Another wizard question:
Is there a way to force the Next button to be enabled even though it "thinks" it's on the last page. I tried

Me.WizardControl1.SetNavigationButtonStatus(WizardNavigationButtons.Next,WizardNavigationButtonStatus.Enabled)

in the PageActivate of the last page but it continued to be disabled.

Thanks,
Randy
Post #2174
Posted 08/11/2006 7:01:48 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 5:44:29 PM
Posts: 4,366, Visits: 4,393
You can insert a blank page after your "real" last page.  Just handle the NextClicked event and prevent it from going to that page.  The control inheriantly disallows end-users from "hurting" themselves by automatically taking account of the last page.  Another option is to just change the text of the finish button.  You can also set the "ShowFinishButtonAsDistinctButton" property to false.  This way the Next and finish buttons share the same space and will never be disabled.
Post #2175
Posted 08/17/2006 8:53:49 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 08/01/2008 8:53:41 AM
Posts: 2,671, Visits: 1,879
We've been able to reproduce the problem and are working on a fix, Jean.  We'll make sure the fix makes it into the next version.


www.bungie.net
Post #2219
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 8:03pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.125. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.