Results 1 to 4 of 4

Thread: [RESOLVED] panels location

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2003
    Posts
    193

    Resolved [RESOLVED] panels location

    I am just trying to set some panels on my form to adjust with the user expansion. THIs is all fine except for 2 panels that sometimes are not shown, then shown later. I basically have 5 panels docked at Top, Bottom, Sides, and middle. THe Left side panel at times must become invisible. THis is fine, the middle panel takes over and stretches. BUT, when I want the left panel to show again. I can't get it to dock again at the left side, it goes to the middle and the previous middle stays on the left....

    THanks for any help....


    Public Class Form1

    Private Sub btnHide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


    PanelLeft.Visible = False
    PanelLeft.Dock = DockStyle.None

    End Sub

    Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

    PanelMiddle.Visible = False
    PanelMiddle.Dock = DockStyle.None


    Dim a As Integer
    a = PanelLeft.Width
    Dim b As Integer
    b = PanelMiddle.Width
    PanelMiddle.Width = b - a ' want to shrink the enlarged middle back to size


    PanelLeft.Location = New System.Drawing.Point(0, 41)
    PanelLeft.Width = 180
    PanelLeft.Dock = DockStyle.Right
    PanelLeft.Visible = True


    PanelMiddle.Location = New System.Drawing.Point(184, 41)

    PanelMiddle.Dock = DockStyle.Fill
    PanelMiddle.Visible = True

    End Sub
    End Class

  2. #2
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Re: panels location

    You're setting the DockStyle of the PanelLeft to DockStyle.Right.
    If my post helps , please feel free to rate it

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2003
    Posts
    193

    Thumbs up Re: panels location

    OMG!.. That is so ridiculously obvious, I really need to step away from the PC for a bit. You get bonus points for not being sarcastic about it...

  4. #4
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Re: [RESOLVED] panels location

    hehe thank you
    If my post helps , please feel free to rate it

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