Results 1 to 3 of 3

Thread: Show hide panels

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Posts
    69

    Show hide panels

    Hi All

    i am trying to have a program with 5 panels
    all of the will load the same size and location
    when the new one loads i whant it should check if there
    is a 2 panel open if yes it should show it when these one
    closes.

    now when a panel opens the panel1.enable=true
    and panel1.visable=true

    if a second panel loads it will check for panels if it will find
    a panel it should panel1.visable=false
    becuse the tab order should be only on the 2 panel.

    if any one has a idea please reply
    Thank You

  2. #2
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    For 2 panels this works, just a little more code for every panel....

    Code:
    Dim c As Control
    For Each c In Me.Controls
        If c Is Panel1 Then
            c.Visible = False
            Panel2.Visible = True
        End If
    Next

  3. #3
    Hyperactive Member RealNickyDude's Avatar
    Join Date
    Nov 2002
    Location
    Watching you through the hidden camera :o
    Posts
    435
    This is how I got round that problem in VB6 with Group Control (I think that's wha it was called). Created a function called CloseAllPanels and have this code for however many panels:
    VB Code:
    1. Panel1.Visable = False
    2. Panel2.Visable = False
    3. Panel3.Visable = False
    4. ..
    5. ..

    Then, whenever you want to show a certain panel, say panel 3 on the click of a button, you'd have something like:
    VB Code:
    1. Private Sub btnShowPanel3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
    2.         CloseAllPanels
    3.         Panel3.Visable=True
    4.     End Sub
    [vbcode]
    On Error GoTo Hell
    [/vbcode]:¬) Nicky : Why not try VBCodebook.NET.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width