Code: Select all
tTable
Dim tTable As New TableView(mainArea) As "Dyntable_root"
Dim i, j As Integer
Dim c As String
Dim code As String = ""
tTable.Columns.Count = 3
tTable.Columns[0].Title = "SAMPLE"
tTable.Columns[0].Width = tTable.Font.TextWidth(tTable.Columns[0].Title) + 10
tTable.Columns[1].Text = "ID"
tTable.Columns[1].Width = tTable.Font.TextWidth(tTable.Columns[1].Title) + 100
tTable.Columns[2].Text = "DATA"
tTable.Columns[2].Width = tTable.Font.TextWidth(tTable.Columns[2].Title) + 200
tTable.Font = parentTable.Font
tTable.Width = 200 'parentTable.Current.Width + 10
tTable.Height = 80 'parentTable.Current.Height - tTable.Top - 5 - 10
tTable.Resizable = True
Now, later on we do this :For cnt = 0 To tTable.Rows.Count - 1
sumVals = sumVals + tTable.Rows[cnt].Height
Next
tTable.Height = sumVals + 2 + tTable.Columns.Height
This sets the eight to 49. I checked.Even below that we set :
tTable.Header = GridView.None
Even now, the height is 49, I checked. There is only one row, with row Height = 21. We turn off the headers with
tTable.Header = GridView.None
Now finally we do :
Dim sumVals As Integer = 0
Dim cnt As Integer = 0
For cnt = 0 To tTable.Rows.Count - 1
Print "adding: ", sumVals, "for ", cnt
sumVals = sumVals + tTable.Rows[cnt].Height
Print cnt, sumVals
Next
Print "headres gone? ", tTable.Header ' prints 0
tTable.Height = sumVals + 2 'alternatively : tTable.Height - tTable.Columns.Height
'tTable.Resize(tTable.Width, sumVals+2) '<--- alternatively I am using this
The table had one row, and it had a height of 21. So this should make the table height = 21 + 2.Indeed I can print that the table height is now 23, but it is adding a few scrollbars! It seems, within the borders, the scrollbar still allows for a total height of 49. So something is making the 49 a persistent height. Even if the outer borders, and printed message agree, that I have tables of height 23 - it seems that inside the table, despite a single row, and turning off the headers via the none option, something of height 49 is still there.
What is wrong? Thank you.