• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 229
  • Last Modified:

Resize proportions for buttons, labels and picture boxes in a panel.

This one is really puzzling me.  I'm in the process of creating a tool for our hydrologists to use, allowing them to browse multiple graphs on various water sources.  Here is what I have: A windows form divided into two parts.  On the left hand side are the controls allowing the user to select which water source they want to view.  These controls consist of a combo box, a label, a checked list box, and three buttons (display graphs, clear data display, and quit application)  The data display is the part with which I am having the problem.  It has been requested that this form be able to display on screens of varying resolution settings.  The original form was created at 640 x 480.  When the screen is maximized to match mine (1280 x 1024) the controls resize perfectly.  However, the data display is causing me problems.  

Data Display.
I've tried this with a panel and a group box, but still can't get these to resize correctly.   At 640 x 480, the panel/group box were both 438 x 420.  The picture boxes are as follows:  Top left 212 x 144, top right 212 x 144, bottom left 212 x 144, bottom middle 102 x 144, bottom right 102 x 144.  Each picture box has a centered label on top of them (labels are 24 pixels tall)  At the bottom of the panel are two buttons, which are used to navigate back and forth between selcted water sources.  I have tried every possible anchor combination available.  No matter which is selected, the pictures do not resize proportionally.  Either the labels vanish, the buttons overlap each other, or one picture box in particular expands to fill the entire panel.

What, if anything, am I doing wrong here, and how in the world can I get the picture boxes on this form to match the size of the screen?

Currently, the only button that I have functioning is the quit button.  I really need to nail down the resizing before anything else can be done with the application.

Code behind the form:


Public Class frmMainMenu
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
    Friend WithEvents sbrStatusBar As System.Windows.Forms.StatusBar
    Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem5 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem6 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem7 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem8 As System.Windows.Forms.MenuItem
    Friend WithEvents lblDataType As System.Windows.Forms.Label
    Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
    Friend WithEvents CheckedListBox1 As System.Windows.Forms.CheckedListBox
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Button3 As System.Windows.Forms.Button
    Friend WithEvents lblDescriptor As System.Windows.Forms.Label
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents pbxSFCLT As System.Windows.Forms.PictureBox
    Friend WithEvents pbxSFMTS As System.Windows.Forms.PictureBox
    Friend WithEvents pbxSFIPTS As System.Windows.Forms.PictureBox
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents btnStreamflowNext As System.Windows.Forms.Button
    Friend WithEvents btnStreamflowPrevious As System.Windows.Forms.Button
    Friend WithEvents pbxFlowDuration As System.Windows.Forms.PictureBox
    Friend WithEvents pbxSeasonal As System.Windows.Forms.PictureBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmMainMenu))
        Me.MainMenu1 = New System.Windows.Forms.MainMenu
        Me.MenuItem1 = New System.Windows.Forms.MenuItem
        Me.MenuItem3 = New System.Windows.Forms.MenuItem
        Me.MenuItem4 = New System.Windows.Forms.MenuItem
        Me.MenuItem5 = New System.Windows.Forms.MenuItem
        Me.MenuItem6 = New System.Windows.Forms.MenuItem
        Me.MenuItem7 = New System.Windows.Forms.MenuItem
        Me.MenuItem8 = New System.Windows.Forms.MenuItem
        Me.MenuItem2 = New System.Windows.Forms.MenuItem
        Me.sbrStatusBar = New System.Windows.Forms.StatusBar
        Me.lblDataType = New System.Windows.Forms.Label
        Me.ComboBox1 = New System.Windows.Forms.ComboBox
        Me.CheckedListBox1 = New System.Windows.Forms.CheckedListBox
        Me.Button1 = New System.Windows.Forms.Button
        Me.Button2 = New System.Windows.Forms.Button
        Me.Button3 = New System.Windows.Forms.Button
        Me.lblDescriptor = New System.Windows.Forms.Label
        Me.Panel1 = New System.Windows.Forms.Panel
        Me.Label1 = New System.Windows.Forms.Label
        Me.pbxFlowDuration = New System.Windows.Forms.PictureBox
        Me.pbxSeasonal = New System.Windows.Forms.PictureBox
        Me.Label5 = New System.Windows.Forms.Label
        Me.pbxSFCLT = New System.Windows.Forms.PictureBox
        Me.pbxSFMTS = New System.Windows.Forms.PictureBox
        Me.pbxSFIPTS = New System.Windows.Forms.PictureBox
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.btnStreamflowNext = New System.Windows.Forms.Button
        Me.btnStreamflowPrevious = New System.Windows.Forms.Button
        Me.Panel1.SuspendLayout()
        Me.SuspendLayout()
        '
        'MainMenu1
        '
        Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem7, Me.MenuItem2})
        '
        'MenuItem1
        '
        Me.MenuItem1.Index = 0
        Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem3, Me.MenuItem6})
        Me.MenuItem1.Text = "File"
        '
        'MenuItem3
        '
        Me.MenuItem3.Index = 0
        Me.MenuItem3.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem4, Me.MenuItem5})
        Me.MenuItem3.Text = "Export"
        '
        'MenuItem4
        '
        Me.MenuItem4.Index = 0
        Me.MenuItem4.Text = "To Word Document"
        '
        'MenuItem5
        '
        Me.MenuItem5.Index = 1
        Me.MenuItem5.Text = "To PowerPoint Presentation"
        '
        'MenuItem6
        '
        Me.MenuItem6.Index = 1
        Me.MenuItem6.Text = "Quit"
        '
        'MenuItem7
        '
        Me.MenuItem7.Index = 1
        Me.MenuItem7.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem8})
        Me.MenuItem7.Text = "Interface"
        '
        'MenuItem8
        '
        Me.MenuItem8.Index = 0
        Me.MenuItem8.Text = "New Comparison"
        '
        'MenuItem2
        '
        Me.MenuItem2.Index = 2
        Me.MenuItem2.Text = "Help"
        '
        'sbrStatusBar
        '
        Me.sbrStatusBar.Location = New System.Drawing.Point(0, 429)
        Me.sbrStatusBar.Name = "sbrStatusBar"
        Me.sbrStatusBar.Size = New System.Drawing.Size(632, 22)
        Me.sbrStatusBar.TabIndex = 0
        '
        'lblDataType
        '
        Me.lblDataType.Font = New System.Drawing.Font("Futura Bk BT", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblDataType.Location = New System.Drawing.Point(8, 8)
        Me.lblDataType.Name = "lblDataType"
        Me.lblDataType.Size = New System.Drawing.Size(176, 23)
        Me.lblDataType.TabIndex = 2
        Me.lblDataType.Text = "Data Type to Display"
        Me.lblDataType.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'ComboBox1
        '
        Me.ComboBox1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.ComboBox1.Font = New System.Drawing.Font("Futura Bk BT", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ComboBox1.Items.AddRange(New Object() {"Stream Flows", "Wells", "Wetlands"})
        Me.ComboBox1.Location = New System.Drawing.Point(8, 40)
        Me.ComboBox1.Name = "ComboBox1"
        Me.ComboBox1.Size = New System.Drawing.Size(176, 24)
        Me.ComboBox1.TabIndex = 3
        Me.ComboBox1.Text = "Select Data Type"
        '
        'CheckedListBox1
        '
        Me.CheckedListBox1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.CheckedListBox1.Font = New System.Drawing.Font("Futura Bk BT", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.CheckedListBox1.Location = New System.Drawing.Point(8, 120)
        Me.CheckedListBox1.Name = "CheckedListBox1"
        Me.CheckedListBox1.Size = New System.Drawing.Size(176, 202)
        Me.CheckedListBox1.TabIndex = 4
        '
        'Button1
        '
        Me.Button1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.Button1.Font = New System.Drawing.Font("Futura Bk BT", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button1.Location = New System.Drawing.Point(8, 368)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(176, 24)
        Me.Button1.TabIndex = 5
        Me.Button1.Text = "Clear Data Display"
        '
        'Button2
        '
        Me.Button2.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.Button2.Font = New System.Drawing.Font("Futura Bk BT", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button2.Location = New System.Drawing.Point(8, 336)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(176, 24)
        Me.Button2.TabIndex = 6
        Me.Button2.Text = "Display Graphs"
        '
        'Button3
        '
        Me.Button3.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.Button3.Font = New System.Drawing.Font("Futura Bk BT", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button3.Location = New System.Drawing.Point(8, 400)
        Me.Button3.Name = "Button3"
        Me.Button3.Size = New System.Drawing.Size(176, 24)
        Me.Button3.TabIndex = 7
        Me.Button3.Text = "Quit"
        '
        'lblDescriptor
        '
        Me.lblDescriptor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.lblDescriptor.Font = New System.Drawing.Font("Futura Bk BT", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblDescriptor.Location = New System.Drawing.Point(8, 72)
        Me.lblDescriptor.Name = "lblDescriptor"
        Me.lblDescriptor.Size = New System.Drawing.Size(176, 40)
        Me.lblDescriptor.TabIndex = 8
        '
        'Panel1
        '
        Me.Panel1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.Panel1.Controls.Add(Me.Label1)
        Me.Panel1.Controls.Add(Me.pbxFlowDuration)
        Me.Panel1.Controls.Add(Me.pbxSeasonal)
        Me.Panel1.Controls.Add(Me.Label5)
        Me.Panel1.Controls.Add(Me.pbxSFCLT)
        Me.Panel1.Controls.Add(Me.pbxSFMTS)
        Me.Panel1.Controls.Add(Me.pbxSFIPTS)
        Me.Panel1.Controls.Add(Me.Label4)
        Me.Panel1.Controls.Add(Me.Label3)
        Me.Panel1.Controls.Add(Me.Label2)
        Me.Panel1.Controls.Add(Me.btnStreamflowNext)
        Me.Panel1.Controls.Add(Me.btnStreamflowPrevious)
        Me.Panel1.Location = New System.Drawing.Point(192, 4)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(438, 420)
        Me.Panel1.TabIndex = 9
        '
        'Label1
        '
        Me.Label1.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.Label1.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom), System.Windows.Forms.AnchorStyles)
        Me.Label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.Label1.Location = New System.Drawing.Point(217, 12)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(1, 362)
        Me.Label1.TabIndex = 14
        Me.Label1.Text = "Label1"
        '
        'pbxFlowDuration
        '
        Me.pbxFlowDuration.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.pbxFlowDuration.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.pbxFlowDuration.Image = CType(resources.GetObject("pbxFlowDuration.Image"), System.Drawing.Image)
        Me.pbxFlowDuration.Location = New System.Drawing.Point(326, 229)
        Me.pbxFlowDuration.Name = "pbxFlowDuration"
        Me.pbxFlowDuration.Size = New System.Drawing.Size(102, 144)
        Me.pbxFlowDuration.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.pbxFlowDuration.TabIndex = 23
        Me.pbxFlowDuration.TabStop = False
        '
        'pbxSeasonal
        '
        Me.pbxSeasonal.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.pbxSeasonal.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.pbxSeasonal.Image = CType(resources.GetObject("pbxSeasonal.Image"), System.Drawing.Image)
        Me.pbxSeasonal.Location = New System.Drawing.Point(222, 229)
        Me.pbxSeasonal.Name = "pbxSeasonal"
        Me.pbxSeasonal.Size = New System.Drawing.Size(102, 144)
        Me.pbxSeasonal.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.pbxSeasonal.TabIndex = 22
        Me.pbxSeasonal.TabStop = False
        '
        'Label5
        '
        Me.Label5.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.Label5.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.Label5.Font = New System.Drawing.Font("Futura Bk BT", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label5.Location = New System.Drawing.Point(222, 196)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(208, 26)
        Me.Label5.TabIndex = 21
        Me.Label5.Text = "Seasonal Discharge and Flow Duration"
        Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'pbxSFCLT
        '
        Me.pbxSFCLT.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.pbxSFCLT.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.pbxSFCLT.Image = CType(resources.GetObject("pbxSFCLT.Image"), System.Drawing.Image)
        Me.pbxSFCLT.Location = New System.Drawing.Point(4, 220)
        Me.pbxSFCLT.Name = "pbxSFCLT"
        Me.pbxSFCLT.Size = New System.Drawing.Size(212, 146)
        Me.pbxSFCLT.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.pbxSFCLT.TabIndex = 20
        Me.pbxSFCLT.TabStop = False
        '
        'pbxSFMTS
        '
        Me.pbxSFMTS.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.pbxSFMTS.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.pbxSFMTS.Image = CType(resources.GetObject("pbxSFMTS.Image"), System.Drawing.Image)
        Me.pbxSFMTS.Location = New System.Drawing.Point(220, 32)
        Me.pbxSFMTS.Name = "pbxSFMTS"
        Me.pbxSFMTS.Size = New System.Drawing.Size(212, 144)
        Me.pbxSFMTS.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.pbxSFMTS.TabIndex = 19
        Me.pbxSFMTS.TabStop = False
        '
        'pbxSFIPTS
        '
        Me.pbxSFIPTS.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.pbxSFIPTS.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.pbxSFIPTS.Image = CType(resources.GetObject("pbxSFIPTS.Image"), System.Drawing.Image)
        Me.pbxSFIPTS.Location = New System.Drawing.Point(4, 32)
        Me.pbxSFIPTS.Name = "pbxSFIPTS"
        Me.pbxSFIPTS.Size = New System.Drawing.Size(212, 144)
        Me.pbxSFIPTS.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.pbxSFIPTS.TabIndex = 18
        Me.pbxSFIPTS.TabStop = False
        '
        'Label4
        '
        Me.Label4.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.Label4.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.Label4.Font = New System.Drawing.Font("Futura Bk BT", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label4.Location = New System.Drawing.Point(6, 196)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(208, 26)
        Me.Label4.TabIndex = 17
        Me.Label4.Text = "Cumulative"
        Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'Label3
        '
        Me.Label3.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.Label3.Anchor = System.Windows.Forms.AnchorStyles.Top
        Me.Label3.Font = New System.Drawing.Font("Futura Bk BT", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label3.Location = New System.Drawing.Point(220, 0)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(212, 24)
        Me.Label3.TabIndex = 16
        Me.Label3.Text = "Monthly Time Series"
        Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'Label2
        '
        Me.Label2.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.Label2.Anchor = System.Windows.Forms.AnchorStyles.Top
        Me.Label2.Font = New System.Drawing.Font("Futura Bk BT", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label2.Location = New System.Drawing.Point(4, 0)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(212, 24)
        Me.Label2.TabIndex = 15
        Me.Label2.Text = "Integration Period Time Series"
        Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'btnStreamflowNext
        '
        Me.btnStreamflowNext.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.btnStreamflowNext.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.btnStreamflowNext.Font = New System.Drawing.Font("Futura Bk BT", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnStreamflowNext.Location = New System.Drawing.Point(222, 382)
        Me.btnStreamflowNext.Name = "btnStreamflowNext"
        Me.btnStreamflowNext.Size = New System.Drawing.Size(208, 24)
        Me.btnStreamflowNext.TabIndex = 13
        Me.btnStreamflowNext.Text = "Next Streamflow"
        '
        'btnStreamflowPrevious
        '
        Me.btnStreamflowPrevious.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.btnStreamflowPrevious.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.btnStreamflowPrevious.Font = New System.Drawing.Font("Futura Bk BT", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnStreamflowPrevious.Location = New System.Drawing.Point(6, 382)
        Me.btnStreamflowPrevious.Name = "btnStreamflowPrevious"
        Me.btnStreamflowPrevious.Size = New System.Drawing.Size(208, 24)
        Me.btnStreamflowPrevious.TabIndex = 12
        Me.btnStreamflowPrevious.Text = "Previous Streamflow"
        '
        'frmMainMenu
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(632, 451)
        Me.Controls.Add(Me.Panel1)
        Me.Controls.Add(Me.lblDescriptor)
        Me.Controls.Add(Me.Button3)
        Me.Controls.Add(Me.Button2)
        Me.Controls.Add(Me.Button1)
        Me.Controls.Add(Me.CheckedListBox1)
        Me.Controls.Add(Me.ComboBox1)
        Me.Controls.Add(Me.lblDataType)
        Me.Controls.Add(Me.sbrStatusBar)
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Name = "frmMainMenu"
        Me.Text = "Tampa Bay Water Hydrology Data Display"
        Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
        Me.Panel1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click

    End Sub

    Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem6.Click
        End 'Quit the application
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        End 'Quit the application
    End Sub
End Class

0
GreyRandall
Asked:
GreyRandall
  • 3
  • 2
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You have to use code to accomplish what you're after.  Here is how to do it.  I have modified the anchor properties and added code in the Panel1 Resize event:

Public Class frmMainMenu
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
    Friend WithEvents sbrStatusBar As System.Windows.Forms.StatusBar
    Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem5 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem6 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem7 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem8 As System.Windows.Forms.MenuItem
    Friend WithEvents lblDataType As System.Windows.Forms.Label
    Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
    Friend WithEvents CheckedListBox1 As System.Windows.Forms.CheckedListBox
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Button3 As System.Windows.Forms.Button
    Friend WithEvents lblDescriptor As System.Windows.Forms.Label
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents pbxSFCLT As System.Windows.Forms.PictureBox
    Friend WithEvents pbxSFMTS As System.Windows.Forms.PictureBox
    Friend WithEvents pbxSFIPTS As System.Windows.Forms.PictureBox
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents btnStreamflowNext As System.Windows.Forms.Button
    Friend WithEvents btnStreamflowPrevious As System.Windows.Forms.Button
    Friend WithEvents pbxFlowDuration As System.Windows.Forms.PictureBox
    Friend WithEvents pbxSeasonal As System.Windows.Forms.PictureBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.MainMenu1 = New System.Windows.Forms.MainMenu
        Me.MenuItem1 = New System.Windows.Forms.MenuItem
        Me.MenuItem3 = New System.Windows.Forms.MenuItem
        Me.MenuItem4 = New System.Windows.Forms.MenuItem
        Me.MenuItem5 = New System.Windows.Forms.MenuItem
        Me.MenuItem6 = New System.Windows.Forms.MenuItem
        Me.MenuItem7 = New System.Windows.Forms.MenuItem
        Me.MenuItem8 = New System.Windows.Forms.MenuItem
        Me.MenuItem2 = New System.Windows.Forms.MenuItem
        Me.sbrStatusBar = New System.Windows.Forms.StatusBar
        Me.lblDataType = New System.Windows.Forms.Label
        Me.ComboBox1 = New System.Windows.Forms.ComboBox
        Me.CheckedListBox1 = New System.Windows.Forms.CheckedListBox
        Me.Button1 = New System.Windows.Forms.Button
        Me.Button2 = New System.Windows.Forms.Button
        Me.Button3 = New System.Windows.Forms.Button
        Me.lblDescriptor = New System.Windows.Forms.Label
        Me.Panel1 = New System.Windows.Forms.Panel
        Me.Label1 = New System.Windows.Forms.Label
        Me.pbxFlowDuration = New System.Windows.Forms.PictureBox
        Me.pbxSeasonal = New System.Windows.Forms.PictureBox
        Me.Label5 = New System.Windows.Forms.Label
        Me.pbxSFCLT = New System.Windows.Forms.PictureBox
        Me.pbxSFMTS = New System.Windows.Forms.PictureBox
        Me.pbxSFIPTS = New System.Windows.Forms.PictureBox
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.btnStreamflowNext = New System.Windows.Forms.Button
        Me.btnStreamflowPrevious = New System.Windows.Forms.Button
        Me.Panel1.SuspendLayout()
        Me.SuspendLayout()
        '
        'MainMenu1
        '
        Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem7, Me.MenuItem2})
        '
        'MenuItem1
        '
        Me.MenuItem1.Index = 0
        Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem3, Me.MenuItem6})
        Me.MenuItem1.Text = "File"
        '
        'MenuItem3
        '
        Me.MenuItem3.Index = 0
        Me.MenuItem3.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem4, Me.MenuItem5})
        Me.MenuItem3.Text = "Export"
        '
        'MenuItem4
        '
        Me.MenuItem4.Index = 0
        Me.MenuItem4.Text = "To Word Document"
        '
        'MenuItem5
        '
        Me.MenuItem5.Index = 1
        Me.MenuItem5.Text = "To PowerPoint Presentation"
        '
        'MenuItem6
        '
        Me.MenuItem6.Index = 1
        Me.MenuItem6.Text = "Quit"
        '
        'MenuItem7
        '
        Me.MenuItem7.Index = 1
        Me.MenuItem7.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem8})
        Me.MenuItem7.Text = "Interface"
        '
        'MenuItem8
        '
        Me.MenuItem8.Index = 0
        Me.MenuItem8.Text = "New Comparison"
        '
        'MenuItem2
        '
        Me.MenuItem2.Index = 2
        Me.MenuItem2.Text = "Help"
        '
        'sbrStatusBar
        '
        Me.sbrStatusBar.Location = New System.Drawing.Point(0, 429)
        Me.sbrStatusBar.Name = "sbrStatusBar"
        Me.sbrStatusBar.Size = New System.Drawing.Size(632, 22)
        Me.sbrStatusBar.TabIndex = 0
        '
        'lblDataType
        '
        Me.lblDataType.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblDataType.Location = New System.Drawing.Point(8, 8)
        Me.lblDataType.Name = "lblDataType"
        Me.lblDataType.Size = New System.Drawing.Size(176, 23)
        Me.lblDataType.TabIndex = 2
        Me.lblDataType.Text = "Data Type to Display"
        Me.lblDataType.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'ComboBox1
        '
        Me.ComboBox1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.ComboBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ComboBox1.Items.AddRange(New Object() {"Stream Flows", "Wells", "Wetlands"})
        Me.ComboBox1.Location = New System.Drawing.Point(8, 40)
        Me.ComboBox1.Name = "ComboBox1"
        Me.ComboBox1.Size = New System.Drawing.Size(176, 24)
        Me.ComboBox1.TabIndex = 3
        Me.ComboBox1.Text = "Select Data Type"
        '
        'CheckedListBox1
        '
        Me.CheckedListBox1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.CheckedListBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.CheckedListBox1.Location = New System.Drawing.Point(8, 120)
        Me.CheckedListBox1.Name = "CheckedListBox1"
        Me.CheckedListBox1.Size = New System.Drawing.Size(176, 191)
        Me.CheckedListBox1.TabIndex = 4
        '
        'Button1
        '
        Me.Button1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.Button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button1.Location = New System.Drawing.Point(8, 368)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(176, 24)
        Me.Button1.TabIndex = 5
        Me.Button1.Text = "Clear Data Display"
        '
        'Button2
        '
        Me.Button2.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.Button2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button2.Location = New System.Drawing.Point(8, 336)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(176, 24)
        Me.Button2.TabIndex = 6
        Me.Button2.Text = "Display Graphs"
        '
        'Button3
        '
        Me.Button3.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.Button3.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button3.Location = New System.Drawing.Point(8, 400)
        Me.Button3.Name = "Button3"
        Me.Button3.Size = New System.Drawing.Size(176, 24)
        Me.Button3.TabIndex = 7
        Me.Button3.Text = "Quit"
        '
        'lblDescriptor
        '
        Me.lblDescriptor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.lblDescriptor.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblDescriptor.Location = New System.Drawing.Point(8, 72)
        Me.lblDescriptor.Name = "lblDescriptor"
        Me.lblDescriptor.Size = New System.Drawing.Size(176, 40)
        Me.lblDescriptor.TabIndex = 8
        '
        'Panel1
        '
        Me.Panel1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.Panel1.Controls.Add(Me.Label1)
        Me.Panel1.Controls.Add(Me.pbxFlowDuration)
        Me.Panel1.Controls.Add(Me.pbxSeasonal)
        Me.Panel1.Controls.Add(Me.Label5)
        Me.Panel1.Controls.Add(Me.pbxSFCLT)
        Me.Panel1.Controls.Add(Me.pbxSFMTS)
        Me.Panel1.Controls.Add(Me.pbxSFIPTS)
        Me.Panel1.Controls.Add(Me.Label4)
        Me.Panel1.Controls.Add(Me.Label3)
        Me.Panel1.Controls.Add(Me.Label2)
        Me.Panel1.Controls.Add(Me.btnStreamflowNext)
        Me.Panel1.Controls.Add(Me.btnStreamflowPrevious)
        Me.Panel1.Location = New System.Drawing.Point(192, 4)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(438, 420)
        Me.Panel1.TabIndex = 9
        '
        'Label1
        '
        Me.Label1.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.Label1.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom), System.Windows.Forms.AnchorStyles)
        Me.Label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.Label1.Location = New System.Drawing.Point(217, 12)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(1, 362)
        Me.Label1.TabIndex = 14
        Me.Label1.Text = "Label1"
        '
        'pbxFlowDuration
        '
        Me.pbxFlowDuration.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.pbxFlowDuration.Anchor = System.Windows.Forms.AnchorStyles.None
        Me.pbxFlowDuration.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.pbxFlowDuration.Location = New System.Drawing.Point(326, 229)
        Me.pbxFlowDuration.Name = "pbxFlowDuration"
        Me.pbxFlowDuration.Size = New System.Drawing.Size(102, 144)
        Me.pbxFlowDuration.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.pbxFlowDuration.TabIndex = 23
        Me.pbxFlowDuration.TabStop = False
        '
        'pbxSeasonal
        '
        Me.pbxSeasonal.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.pbxSeasonal.Anchor = System.Windows.Forms.AnchorStyles.None
        Me.pbxSeasonal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.pbxSeasonal.Location = New System.Drawing.Point(222, 229)
        Me.pbxSeasonal.Name = "pbxSeasonal"
        Me.pbxSeasonal.Size = New System.Drawing.Size(102, 144)
        Me.pbxSeasonal.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.pbxSeasonal.TabIndex = 22
        Me.pbxSeasonal.TabStop = False
        '
        'Label5
        '
        Me.Label5.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.Label5.Anchor = System.Windows.Forms.AnchorStyles.None
        Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label5.Location = New System.Drawing.Point(222, 196)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(208, 26)
        Me.Label5.TabIndex = 21
        Me.Label5.Text = "Seasonal Discharge and Flow Duration"
        Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'pbxSFCLT
        '
        Me.pbxSFCLT.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.pbxSFCLT.Anchor = System.Windows.Forms.AnchorStyles.Left
        Me.pbxSFCLT.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.pbxSFCLT.Location = New System.Drawing.Point(4, 232)
        Me.pbxSFCLT.Name = "pbxSFCLT"
        Me.pbxSFCLT.Size = New System.Drawing.Size(212, 144)
        Me.pbxSFCLT.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.pbxSFCLT.TabIndex = 20
        Me.pbxSFCLT.TabStop = False
        '
        'pbxSFMTS
        '
        Me.pbxSFMTS.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.pbxSFMTS.Anchor = System.Windows.Forms.AnchorStyles.Top
        Me.pbxSFMTS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.pbxSFMTS.Location = New System.Drawing.Point(220, 32)
        Me.pbxSFMTS.Name = "pbxSFMTS"
        Me.pbxSFMTS.Size = New System.Drawing.Size(212, 144)
        Me.pbxSFMTS.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.pbxSFMTS.TabIndex = 19
        Me.pbxSFMTS.TabStop = False
        '
        'pbxSFIPTS
        '
        Me.pbxSFIPTS.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.pbxSFIPTS.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.pbxSFIPTS.Location = New System.Drawing.Point(4, 32)
        Me.pbxSFIPTS.Name = "pbxSFIPTS"
        Me.pbxSFIPTS.Size = New System.Drawing.Size(212, 144)
        Me.pbxSFIPTS.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.pbxSFIPTS.TabIndex = 18
        Me.pbxSFIPTS.TabStop = False
        '
        'Label4
        '
        Me.Label4.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.Label4.Anchor = System.Windows.Forms.AnchorStyles.Left
        Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label4.Location = New System.Drawing.Point(6, 196)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(208, 26)
        Me.Label4.TabIndex = 17
        Me.Label4.Text = "Cumulative"
        Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'Label3
        '
        Me.Label3.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.Label3.Anchor = System.Windows.Forms.AnchorStyles.Top
        Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label3.Location = New System.Drawing.Point(220, 0)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(212, 24)
        Me.Label3.TabIndex = 16
        Me.Label3.Text = "Monthly Time Series"
        Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'Label2
        '
        Me.Label2.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label2.Location = New System.Drawing.Point(4, 0)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(212, 24)
        Me.Label2.TabIndex = 15
        Me.Label2.Text = "Integration Period Time Series"
        Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'btnStreamflowNext
        '
        Me.btnStreamflowNext.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.btnStreamflowNext.Anchor = System.Windows.Forms.AnchorStyles.Bottom
        Me.btnStreamflowNext.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnStreamflowNext.Location = New System.Drawing.Point(222, 382)
        Me.btnStreamflowNext.Name = "btnStreamflowNext"
        Me.btnStreamflowNext.Size = New System.Drawing.Size(208, 24)
        Me.btnStreamflowNext.TabIndex = 13
        Me.btnStreamflowNext.Text = "Next Streamflow"
        '
        'btnStreamflowPrevious
        '
        Me.btnStreamflowPrevious.AccessibleRole = System.Windows.Forms.AccessibleRole.None
        Me.btnStreamflowPrevious.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.btnStreamflowPrevious.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnStreamflowPrevious.Location = New System.Drawing.Point(6, 382)
        Me.btnStreamflowPrevious.Name = "btnStreamflowPrevious"
        Me.btnStreamflowPrevious.Size = New System.Drawing.Size(208, 24)
        Me.btnStreamflowPrevious.TabIndex = 12
        Me.btnStreamflowPrevious.Text = "Previous Streamflow"
        '
        'frmMainMenu
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(632, 451)
        Me.Controls.Add(Me.Panel1)
        Me.Controls.Add(Me.lblDescriptor)
        Me.Controls.Add(Me.Button3)
        Me.Controls.Add(Me.Button2)
        Me.Controls.Add(Me.Button1)
        Me.Controls.Add(Me.CheckedListBox1)
        Me.Controls.Add(Me.ComboBox1)
        Me.Controls.Add(Me.lblDataType)
        Me.Controls.Add(Me.sbrStatusBar)
        Me.Name = "frmMainMenu"
        Me.Text = "Tampa Bay Water Hydrology Data Display"
        Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
        Me.Panel1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click

    End Sub

    Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem6.Click
        End 'Quit the application
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        End 'Quit the application
    End Sub

    Private Sub Panel1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Panel1.Resize
        Dim pbHeight As Single = (btnStreamflowPrevious.Top - pbxSFIPTS.Top - 62) / 2

        Label1.Left = Panel1.Width / 2 ' halfway across panel

        ' top left quadrant
        Label2.Width = Label1.Left - Label2.Left - 3
        pbxSFIPTS.Width = Label1.Left - pbxSFIPTS.Left - 3
        pbxSFIPTS.Height = pbHeight

        ' top right quadrant
        Label3.Left = Label1.Left + 3
        Label3.Width = Panel1.Width - Label3.Left - 3
        pbxSFMTS.Left = Label1.Left + 3
        pbxSFMTS.Width = Panel1.Width - pbxSFMTS.Left - 3
        pbxSFMTS.Height = pbHeight

        ' bottom left quadrant
        Label4.Top = pbxSFIPTS.Top + pbxSFIPTS.Height + 20
        Label4.Width = Label1.Left - Label4.Left - 3
        pbxSFCLT.Top = Label4.Top + 36
        pbxSFCLT.Width = Label1.Left - pbxSFCLT.Left - 3
        pbxSFCLT.Height = pbHeight

        ' bottom right quadrant
        Label5.Left = Label1.Left + 3
        Label5.Width = Panel1.Width - Label5.Left - 3
        pbxSeasonal.Left = Label1.Left + 3
        pbxSeasonal.Top = Label5.Top + 36
        pbxSeasonal.Height = pbHeight
        pbxFlowDuration.Top = Label5.Top + 36
        pbxFlowDuration.Height = pbHeight
        Dim pbWidth As Single = (Panel1.Width - pbxSeasonal.Left - 6) / 2
        pbxSeasonal.Width = pbWidth
        pbxFlowDuration.Left = pbxSeasonal.Left + pbWidth + 3
        pbxFlowDuration.Width = pbWidth

        ' buttons
        btnStreamflowPrevious.Width = Label1.Left - btnStreamflowPrevious.Left - 3
        btnStreamflowNext.Left = Label1.Left + 3
        btnStreamflowNext.Width = Panel1.Width - btnStreamflowNext.Left - 3
    End Sub

End Class
0
 
Bob LearnedCommented:
Do you know anything about anchoring?

Bob
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Hey Bob,

Basically he has a Panel that resizes to fill the right half of the form via Anchoring.  Inside that Panel are four quardrants.  Each quadrant has a label and a picturebox, except the bottom right quadrant, which has two pictureboxes that are side by side instead of just one.  Across the bottom of the panel are two buttons.  The Panel basically looks like this:

+----------------------------+
|      Label          Label     |
| +----------+ +----------+ |
| |              ||              | |
| +----------+ +----------+ |
|      Label          Label     |
| +----------+ +---+ +---+ |
| |              ||     | |     | |
| +----------+ +---+ +---+ |
|     Button        Button     |
+----------------------------+

So what GreyRandall wants is that with the exception of the buttons across the bottom, the panel is divided equally into four quadrants and the pictureboxes resize to fill their respective quardrants as the form (and consequently the panel) is resized.

I don't think you can accomplish that kind of behaviour with just anchoring/docking alone, since anchoring strives to maintain a distance from edges and not a percentage of a container.

There is probably a more efficient way to do it via code than mine however.  =)

~IM
0
 
Bob LearnedCommented:
Wow, Mike, you really have a lot of time on your hands!  A picture is worth a couple of thousand words.  I didn't catch all that in the noise that the code was producing.  I admittedly didn't run it, though, so it was a touch more difficult to decipher.  Thanks for clearing that up.

Bob
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Your welcome...and yes I have alot of time on my hands.  Remember I'm a stay@home dad. =)

Pretty sure I interpreted what GreyRandall wanted correctly...but if I'm wrong it wouldn't be the first time.  ;)

BTW, you start that new job yet?

Mike
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now