CreateSQLQuery动态创建的表格,如何设置SetBounds,使得表格的每一列能自动大小?如何得到autosizecols之后的大小?
Dim tbl As WinForm.Table
Dim comm As String
comm = "selexxxxx from {RecordValue}"
tbl = e.Form.CreateSQLQuery("Table1", comm, "productuiondata")
tbl.BindTable.AutoSizeCols
Dim i As Integer
For Each cc As Col In tbl.BindTable.Cols
i += cc.Width
Next
tbl.SetBounds(0, e.Form.Controls("TextBox1").Height, 1000, i)
e.Form.AddControl(tbl)
这样子不行,会报错
Dim tbl As WinForm.Table
Dim comm As String
comm = "select * from {RecordValue}"
tbl = e.Form.CreateSQLQuery("Table1", comm, "productuiondata")
e.Form.AddControl(tbl)
tbl.Table.AutoSizeCols
Dim i As Integer
For Each cc As Col In tbl.Table.Cols
i += cc.PrintWidth *96/25.4
Next
tbl.SetBounds(0, e.Form.Controls("TextBox1").Height+5, i + 35, 1000)