I'm nearing the end of Rev 0 of a project but have stumbled over the form resizing issue. I understand that to resize based upon a screens resolution you should add a TableLayoutPanel. Well, I did so, basically creating a one row-one column table - (best I can do with this design is one row-two column) and moved it to the back. The Charts that I was generating are done so dynamically, and they no longer appear as they had before. I'm not certain how to go about getting the charts and all other controls to reappear.
And later
TableLayoutPanel1 properties: Anchor: Top,Left; AutoSize:True; AutoSizeMode: GrowAndShrink; ColumnCount: 1; RowCount: 1; Dock: Fill
VB.NET:
If ChartIsNew = True Then
Chart1 = New Chart() 'Create a Chart
Chart2 = New Chart()
Chart3 = New Chart()
Chart4 = New Chart()
Chart5 = New Chart()
Chart6 = New Chart()
ChartIsNew = False
Me.TableLayoutPanel1.SuspendLayout()
Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle())
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize))
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.AutoSize))
Me.TableLayoutPanel1.AutoSizeMode = Windows.Forms.AutoSizeMode.GrowAndShrink
Me.TableLayoutPanel1.AutoSize = True
Me.TableLayoutPanel1.Dock = DockStyle.Fill
Me.TableLayoutPanel1.Anchor = AnchorStyles.Left And AnchorStyles.Top
Me.TableLayoutPanel1.Controls.Add(Me.Chart1, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Chart2, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Chart3, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Chart4, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Chart5, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Chart6, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Calendar1, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.BackButton, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Label1, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Panel1, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.MoonPhasePic, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.EnlargeChart, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.HideSer3c, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.HideSer3d, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.HideSer4c, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.HideSer4d, 0, 0)
Me.TableLayoutPanel1.ColumnCount = 1
Me.TableLayoutPanel1.RowCount = 1
Me.TableLayoutPanel1.TabIndex = 1
Me.Controls.Add(TableLayoutPanel1)
Me.TableLayoutPanel1.ResumeLayout(False)
Me.TableLayoutPanel1.PerformLayout()
End If
And later
VB.NET:
Me.Chart1.Name = "ImageFreqByYear"
Me.Chart1.TabIndex = 0
Me.Chart1.Text = "Image Frequency Per Year"
Me.Chart1.BringToFront()
Me.Chart1.Anchor = AnchorStyles.Left And AnchorStyles.Top
Me.Chart1.Dock = DockStyle.None
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Chart1}) ' Add chart control to the form
TableLayoutPanel1 properties: Anchor: Top,Left; AutoSize:True; AutoSizeMode: GrowAndShrink; ColumnCount: 1; RowCount: 1; Dock: Fill
Last edited: