Forms, and group boxes laying

Hi,

I have one form with four group boxes on, each group box has its own set of controls. The group boxes are layered over each other and by default when the form is displayed the first group box is visable and the rest are hidden...

When the user clicks on a "next" button the first group box is visible = false and the second group box is visable= true....

My issue is that when the group boxes are overlapped and I click on "next" to display the seond group box it never gets displayed I am not sure why....

Any thoughts...?




Private Sub btn_next_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_next.Click
 
        Me.btn_start.Enabled = False
 
        If (Me.grp_screen1_startdate.Visible = True) Then
 
            Me.grp_screen1_startdate.Visible = False
            Me.grp_screen2_funds.BringToFront()
            Me.btn_back.Enabled = True
 
        ElseIf (Me.grp_screen2_funds.Visible = True) Then
 
            Me.grp_screen2_funds.Visible = False
            Me.grp_screen3_curr.Visible = True
 
        ElseIf (Me.grp_screen3_curr.Visible = True) Then
 
            Me.grp_screen3_curr.Visible = False
            Me.btn_next.Enabled = False
            Me.grp_screen4_process.Visible = True
            Me.btn_start.Enabled = True
 
        End If
 
    End Sub

Open in new window

LVL 1
ISCAsked:
Who is Participating?
 
EE_AutoDeleterConnect With a Mentor Commented:
ISC,
Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.

EE_AutoDeleter
0
 
ISCAuthor Commented:
Sorry a correction to the code...

Private Sub btn_next_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_next.Click

        Me.btn_start.Enabled = False

        If (Me.grp_screen1_startdate.Visible = True) Then

            Me.grp_screen1_startdate.Visible = False
            Me.grp_screen2_funds.Visible = True
            Me.btn_back.Enabled = True

        ElseIf (Me.grp_screen2_funds.Visible = True) Then

            Me.grp_screen2_funds.Visible = False
            Me.grp_screen3_curr.Visible = True

        ElseIf (Me.grp_screen3_curr.Visible = True) Then

            Me.grp_screen3_curr.Visible = False
            Me.btn_next.Enabled = False
            Me.grp_screen4_process.Visible = True
            Me.btn_start.Enabled = True

        End If

    End Sub
0
 
ISCAuthor Commented:
I think it is something to do with the layering of group boxes over each other...
0
 
ISCAuthor Commented:
I have sorted it, when I layered the groups boxes over each other they became a group box whithin a group box....

I have resolved by View=>Other Winodws=>Dcoument Outline and ensuing there is no groupbox within another groupbox...

Issue solved..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.