Hi Michel,
I pasted the code right below the " Windows Form Designer generated code"
region, and the region was closed so it should not have overwriten any of
that code. Right After pasting the code, the tabcontrol disapeared from the
form without any error messages showing. After more investigation, I found 4
of the 5 tabpages in the code (in the region above). Somehow the tabcontrol
and 1 tabpage was totally removed from the form somehow. The form has no code
except for a few other control loading (conbos & flexgrid) functions. Here is
the code I pasted into the form.
Private Sub SetHeaders()
Dim i%
' initialize control
flxFamilyHistory1.Styles.Normal.WordWrap = True
flxFamilyHistory1.Cols.Count = 6
flxFamilyHistory1.Rows.Fixed = 2
flxFamilyHistory1.AllowMerging = AllowMergingEnum.FixedOnly
' create row headers
flxFamilyHistory1.Rows(0).AllowMerging = True
' four cells, will merge
Dim rng As CellRange = flxFamilyHistory1.GetCellRange(0, 1, 0, 2)
rng.Data = "If Living"
' four cells, will merge
rng = flxFamilyHistory1.GetCellRange(0, 3, 0, 4)
rng.Data = "If Deceased"
flxFamilyHistory1(1, 1) = "Age"
flxFamilyHistory1(1, 2) = "Health"
flxFamilyHistory1(1, 3) = "Age of Death"
flxFamilyHistory1(1, 4) = "Cause of Death"
flxFamilyHistory1(1, 5) = "Who"
' create column header
flxFamilyHistory1.Cols(0).AllowMerging = True
' two cells, will merge
rng = flxFamilyHistory1.GetCellRange(0, 0, 1, 0)
rng.Data = "Person"
' align and autozise the cells
flxFamilyHistory1.Styles.Fixed.TextAlign = TextAlignEnum.CenterCenter
flxFamilyHistory1.AutoSizeCols(1, flxFamilyHistory1.Cols.Count - 2,
10)
flxFamilyHistory1.Cols(5).Width = 150
End Sub
Private Sub SetFixedColumn()
flxFamilyHistory1(2, 0) = "Father"
flxFamilyHistory1(3, 0) = "Mother"
flxFamilyHistory1(4, 0) = "Brothers"
flxFamilyHistory1(9, 0) = "Sisters"
End Sub
The form will not load right now because the VB generated code still has
references to controls that where removed/lost saying that the control is not
a member of the form. Yet it still has the code like:
Me.Label4 = New System.Windows.Forms.Label
further down in the code:
Me.TabPage1.Controls.Add(Me.Label4)
further down in the code:
Me.Label4.Location = New System.Drawing.Point(16, 339)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(176, 16)
Me.Label4.TabIndex = 5
Me.Label4.Text = "Have you ever had a transfusion?"
Does any of this make since to anyone. Thanks for the reply and suggestions.
Michael