G
Guest
My application addes or deletes tab pahes at the user's discretion. On each
tab page are controls that must be duplicated. Here's a sample of my code:
chart_tabcontrol.TabPages.Add(1)
chart_tabcontrol.SelectedTab =
chart_tabcontrol.TabPages(chart_tabcontrol.TabPages.Count - 1)
chart_tabcontrol.Refresh()
chart_tabcontrol.SelectedTab.Text = "Chart " &
chart_tabcontrol.TabPages.Count.ToString
Dim genericSeriesTypes_label As New Label
genericSeriesTypes_label.Left = chartSeriesTypes_label1.Left
genericSeriesTypes_label.Top = chartSeriesTypes_label1.Top
genericSeriesTypes_label.Size = chartSeriesTypes_label1.Size
genericSeriesTypes_label.TextAlign = chartSeriesTypes_label1.TextAlign
genericSeriesTypes_label.Font = chartSeriesTypes_label1.Font
chart_tabcontrol.SelectedTab.Controls.Add(genericSeriesTypes_label)
genericSeriesTypes_label.Text = "Chart Series Types:"
Note that I assign the property values of the original control to each
derived control. This was fine at first, except that I keep encountering
more properties that I need to accomodate, so the list just keeps growing.
Isn't there an easier way to grab every property at once, perhaps using
inheritance? I'm new to this concept and can't find any examples yet in text
or on Google; everything I've found so far just refers to either forms or
class modules.
tab page are controls that must be duplicated. Here's a sample of my code:
chart_tabcontrol.TabPages.Add(1)
chart_tabcontrol.SelectedTab =
chart_tabcontrol.TabPages(chart_tabcontrol.TabPages.Count - 1)
chart_tabcontrol.Refresh()
chart_tabcontrol.SelectedTab.Text = "Chart " &
chart_tabcontrol.TabPages.Count.ToString
Dim genericSeriesTypes_label As New Label
genericSeriesTypes_label.Left = chartSeriesTypes_label1.Left
genericSeriesTypes_label.Top = chartSeriesTypes_label1.Top
genericSeriesTypes_label.Size = chartSeriesTypes_label1.Size
genericSeriesTypes_label.TextAlign = chartSeriesTypes_label1.TextAlign
genericSeriesTypes_label.Font = chartSeriesTypes_label1.Font
chart_tabcontrol.SelectedTab.Controls.Add(genericSeriesTypes_label)
genericSeriesTypes_label.Text = "Chart Series Types:"
Note that I assign the property values of the original control to each
derived control. This was fine at first, except that I keep encountering
more properties that I need to accomodate, so the list just keeps growing.
Isn't there an easier way to grab every property at once, perhaps using
inheritance? I'm new to this concept and can't find any examples yet in text
or on Google; everything I've found so far just refers to either forms or
class modules.