-
Apr 10th, 2010, 05:09 PM
#41
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Nick,
When playing around with your control, I'm not able to see a change when the visible property of a page is set to False.
Whether I set it in the designer or during run time, it doesn't reflect when changing pages.
Do you know why this might be?
Thanks
CodeBank contributions: Process Manager, Temp File Cleaner
Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Apr 10th, 2010, 05:12 PM
#42
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Hm, why are you setting the visible property to false?
I think I'm using the visible property to hide/show the pages when appropriate (alongside bringing them to the front). So it is going to be changed all the time by the container control, when you change the selected page.
-
Apr 10th, 2010, 05:20 PM
#43
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
I have 4 CheckBoxes that allows the user to select which pages they need to use. If, for instance, they only need to work with the content that is on page 2, I need to be able to not show pages 1, 3, and 4.
CodeBank contributions: Process Manager, Temp File Cleaner
Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Apr 10th, 2010, 05:25 PM
#44
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
That's not usually how a wizard works, but ok
Hm. I'm not too sure how to approach this. You can handle the button events (I think there's NextButtonClicked, etc), which should have a Cancel property in the event arguments (e). Well, I showed someone how to add that property once, I'm not really sure if I've added it to the actual project yet.
Anyway, that would allow you to cancel navigation when you don't want it.
-
Apr 10th, 2010, 09:09 PM
#45
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Thanks for the info, Nick.
I'll play around with it to see what I can figure out.
Originally Posted by NickThissen
That's not usually how a wizard works, but ok
Yeah... I guess not. I need the functionality of a wizard, with this specific option. And since this part of the GUI is integral to the main functionality of the app, I can't move forward until I get this figured out.
Thanks again
CodeBank contributions: Process Manager, Temp File Cleaner
Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Apr 12th, 2010, 10:33 AM
#46
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Nick,
When trying to import your control into a new project, instead of testing out the project example, I'm not able to fully import the ThreeDLine.vb file.
When importing WizardCtrl.vb and WizardPage.vb, it imports the appropriate designer and resx files. When importing the ThreeDLine.vb file, it doesn't import the 3DLine.Designer.vb and 3DLine.resx files. I can import them separately, but they aren't tied to the 3DLine.vb file.
Do you know why this might be? Could it be something with what VS you developed it in? I think you must have used VS 2005 to develop it since it has me upgrade the files prior to opening the project.
CodeBank contributions: Process Manager, Temp File Cleaner
Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Apr 12th, 2010, 10:53 AM
#47
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Hm, perhaps it has to do with the name... Try renaming all files to the same name (ThreeDLine instead of 3DLine, I don't know if you can use numbers) before adding the file.
Not sure why I didn't get that. I can't remember if I made this in VS2005 but I used it in VS2008 as well, pretty sure about that.
-
Apr 12th, 2010, 11:43 AM
#48
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
It seems the naming was the issue.
Thanks
CodeBank contributions: Process Manager, Temp File Cleaner
Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Oct 23rd, 2010, 07:23 PM
#49
-
Oct 24th, 2010, 05:14 AM
#50
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
I'm sure you can just place two images there with some mouse hover and click events. Although the background between the images is probably a little more difficult.
-
Oct 24th, 2010, 09:28 AM
#51
Frenzied Member
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
I see thanks for the reply.
-
Apr 8th, 2011, 10:56 AM
#52
Member
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
I hate to bump an old thread, but I'm having a redraw/cleanup issue with the wizard control. I've done the following:
- Downloaded latest non-Aero version
- Rename appropriate ThreeDLine files
- Create new project in VS 2008
- Add existing items...selected source files
- Build project
- Add wizard control to userform
- set wizard control DockStyle to Fill
- Debug/Run project
- Stop debugging
After this, the design-time view of my userform no longer shows the wizard control. Closing the userform's designer and reopening it fixes the problem. Is this some sort of dispose/finalize bug? I don't know enough about .Net and/or user controls to really track what is happening.
The two images display what I'm trying to write. The first is a view of my project before I debug/run. The second is after I stop debugging. When I close and reopen formMain.vb, everything looks like the first image again.
Thanks.
-
Apr 8th, 2011, 11:27 AM
#53
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
I'm not sure what is causing the problem, but I do have a workaround (that's actually better practice then what you are doing). Instead of dumping all the files in your Windows Forms Application project, add a new Windows Forms Control Library project to your solution (I am assuming you're using Visual Studio and not one of the Express versions). Then add the files to that control library project (be sure to reference System.Design) and reference the control library project from your main project. When doing this, the control no longer disappears from my form. Again, I have no idea why, but it works for me.
If you do have the Express versions, you can always create a new Class Library project (I don't think Control Library is available in Express?), add the required references (System.Windows.Forms probably and maybe some others), and build it. Then you get a DLL file that you can reference from your main project, and it should work the same.
-
Apr 8th, 2011, 11:33 AM
#54
Member
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Okay thanks. I'll have to try the Express version of your work-around.
-
Apr 8th, 2011, 12:51 PM
#55
Member
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Work-around is great! Also, before I tried your work-around, I discovered that if I added a second wizard page to the control (during design-time), the disappearing control problem went away.
Also, the updated wizard control that includes the cancel button_press events, removed the code that toggles the visibility of the header panel based on the value of a wizard page's IsWelcomePage property. The code for the cancel event wizard control:
Code:
Public Overridable Sub OnSelectedPageChanged(ByVal e As EventArgs)
Static oldSelection As WizardPage = Nothing
If Not (oldSelection Is Nothing) Then
oldSelection.Visible = False
End If
If Not (m_SelectedPage Is Nothing) Then
CType(m_SelectedPage, WizardPage).Visible = True
End If
Dim tabChanged As Boolean
If m_SelectedPage Is Nothing Then
tabChanged = Not (oldSelection Is Nothing)
Else
tabChanged = Not (m_SelectedPage.Equals(oldSelection))
End If
If tabChanged And Me.Created Then
RaiseEvent SelectedIndexChanged(Me, EventArgs.Empty)
End If
oldSelection = CType(m_SelectedPage, WizardPage)
' Update title/description/icon
Dim page As WizardPage = Me.SelectedPage
If page IsNot Nothing Then
Me.Invalidate()
If page.Icon IsNot Nothing Then
Me.picIcon.Image = page.Icon
Me.picIcon.Visible = True
Else
Me.picIcon.Visible = False
End If
btnPrev.Enabled = (Me.SelectedIndex > 0)
If page.IsLastPage Then
btnNext.Text = FinishButtonText
ElseIf page.IsWelcomePage Then
btnNext.Text = StartButtonText
Else
btnNext.Text = NextButtonText
End If
End If
End Sub
The code how I modified it:
Code:
Public Overridable Sub OnSelectedPageChanged(ByVal e As EventArgs)
Static oldSelection As WizardPage = Nothing
If Not (oldSelection Is Nothing) Then
oldSelection.Visible = False
End If
If Not (m_SelectedPage Is Nothing) Then
CType(m_SelectedPage, WizardPage).Visible = True
End If
Dim tabChanged As Boolean
If m_SelectedPage Is Nothing Then
tabChanged = Not (oldSelection Is Nothing)
Else
tabChanged = Not (m_SelectedPage.Equals(oldSelection))
End If
If tabChanged And Me.Created Then
RaiseEvent SelectedIndexChanged(Me, EventArgs.Empty)
End If
oldSelection = CType(m_SelectedPage, WizardPage)
' Update title/description/icon
Dim page As WizardPage = Me.SelectedPage
If page IsNot Nothing Then
Me.lblPageTitle.Text = page.Title
Me.lblDescription.Text = page.Description
If page.Icon IsNot Nothing Then
Me.picIcon.Image = page.Icon
Me.picIcon.Visible = True
Else
Me.picIcon.Visible = False
End If
btnPrev.Enabled = (Me.SelectedIndex > 0)
If page.IsLastPage Then
btnNext.Text = FinishButtonText
Else
btnNext.Text = NextButtonText
End If
If page.IsWelcomePage Then
btnNext.Text = StartButtonText
Me.Top3DLine.Visible = False
Me.pnlHeader.Visible = False
Else
Me.Top3DLine.Visible = True
Me.pnlHeader.Visible = True
End If
Me.Invalidate()
End If
End Sub
Hopefully that made sense. The changes come after the comment "Update title/description/icon".
-
Sep 2nd, 2011, 07:16 AM
#56
Hyperactive Member
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Sorry to bump...
Nick, how would I have the form close after the finish button has been clicked?
Currently... This code:
Code:
Private Sub wizard_AddSupplier_NextButton_Clicked(ByVal WasLastPage As Boolean) Handles wizard_AddSupplier.NextButton_Clicked
If (WasLastPage) Then
If (Supplier.saveSupplier()) Then
MsgBox("The Supplier with Reference: " + Supplier.Reference().ToString() + ", has been added to the System", MsgBoxStyle.Information, "Supplier Added")
Me.Close()
Else
MsgBox("An error occured when trying to Add the Supplier", MsgBoxStyle.Exclamation, "Unable to Add Supplier")
End If
End If
End Sub
Produces, this error:
Index 0 is out of range.
Parameter name: index
Thanks.
-
Sep 2nd, 2011, 07:48 AM
#57
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Where does that error occur? If you're using the source code you should be able to tell my exactly where it goes wrong. If you are using a compiled version, does it error before it even raises the NextButton_Clicked event or somewhere in your own code?
-
Sep 2nd, 2011, 09:50 AM
#58
Hyperactive Member
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Originally Posted by NickThissen
Where does that error occur? If you're using the source code you should be able to tell my exactly where it goes wrong. If you are using a compiled version, does it error before it even raises the NextButton_Clicked event or somewhere in your own code?
It happens on the 'Set' of the SelectedIndex() Property in WizardCtrl.vb on the line:
Code:
Me.SelectedPage = DirectCast(Me.Pages(Value), WizardPage)
-
Nov 10th, 2011, 09:39 AM
#59
New Member
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Hey Nick,
first i want to thank you for this easy to use control
and second: did you find a solution for r000t's error? i've got the same, when i try to clode the wizard after clicking the finish-button.
-
Nov 10th, 2011, 09:48 AM
#60
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Originally Posted by NoobOne
Hey Nick,
first i want to thank you for this easy to use control
and second: did you find a solution for r000t's error? i've got the same, when i try to clode the wizard after clicking the finish-button.
Hmm, it seems like it is trying to set the SelectedIndex property to 0, but I don't know why, I'll have to look in the source code, and I won't have time for that soon.
Perhaps one of you can take a look where this happens? Does it happen after the Me.Close call is made, or even before that? If it happens before that line (you can check by putting a breakpoint on the Me.Close call) then it must be somewhere in the Next button clicking event (in the control source). If not, it must be something related to the control being disposed, in which case it might also be an error in the design-time code...
-
Nov 10th, 2011, 10:01 AM
#61
New Member
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Thanks for the fast reply. I've checked, where this error exactly occurs:
1. Setting a breakpoint on Me.Close()
2. It jumps into this sub:
Code:
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Dim i As Integer = Me.Pages.Count - 1
RaiseEvent NextButton_Clicked(CType(Me.Pages(Me.SelectedIndex), WizardPage).IsLastPage)
If Me.SelectedIndex < i Then
Me.SelectedIndex += 1
End If
End Sub
3. SelectedIndex is -1 when jumping into above sub
4. the sub sets it to +1 = 0
5. and the error occurs in the Property:
Code:
Public Property SelectedIndex() As Int32
Get
Return Me.Pages.IndexOf(CType(Me.SelectedPage, WizardPage))
End Get
Set(ByVal Value As Int32)
If Value = -1 Then
Me.SelectedPage = Nothing
Else
Me.SelectedPage = DirectCast(Me.Pages(Value), WizardPage)
End If
End Set
End Property
on this line
Code:
Me.SelectedPage = DirectCast(Me.Pages(Value), WizardPage)
It seems the inital error is in the btnNext_Click-Sub, because there the SelectedIndex is set to a wrong value.
-
Nov 10th, 2011, 10:06 AM
#62
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Ok, thanks. It seems the pages are being disposed from the form once you run the Close call. This happens in the RaiseEvent call from your first code snippet. After that, it sets the SelectedIndex to the next page, but only if there is a next page.
The error is that this "is there a next page?" check is done before the RaiseEvent and thus before all pages are removed. Before the RaiseEvent, i = the number of pages - 1. If nothing happens with the page count in the NextButton_Click event, i doesn't change. But in this case, the page count changes and i is outdated. I think simply moving the assignment of i to behind the RaiseEvent call would fix it:
Code:
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
RaiseEvent NextButton_Clicked(CType(Me.Pages(Me.SelectedIndex), WizardPage).IsLastPage)
Dim i As Integer = Me.Pages.Count - 1
If Me.SelectedIndex < i Then
Me.SelectedIndex += 1
End If
End Sub
-
Nov 10th, 2011, 10:12 AM
#63
New Member
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
That's it.
Now it closes without any errors.
Btw. how you want to be mentioned in a released program? a line in the About-Dialog?
-
Nov 10th, 2011, 10:20 AM
#64
Re: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support
Whatever you want is fine by me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|