【求助】窗体table怎么设置窗体大小改变之后,table表中的列也对应进行比例放大或缩小呢?不然窗体拉大,table中会存在空余部分,不美观
【有点色老师】思路解决如下:
如果是sqltable格式时代码放在窗体启动时,及大小改变后事件代码中:
Dim t As Table = Tables("登记订货_Table1")
Dim width As Double = t.grid.width
Dim sum As Double = 0
For Each c As object In t.grid.cols
If c.visible = True Then
sum += c.widthdisplay
End If
Next
For Each c As object In t.grid.cols
If c.visible = True Then
c.width = c.widthdisplay/sum*width
End If
Next
如果是table格式时代码放在窗体启动时,及大小改变后事件代码中:
Dim t As Table = Tables("Table1")
Dim width As Double = t.grid.width
Dim sum As Double = 0
For Each c As object In t.grid.cols
If c.visible = True Then
sum += c.widthdisplay
End If
Next
For Each c As object In t.grid.cols
If c.visible = True Then
c.width = c.widthdisplay/sum*width
End If
Next
[此贴子已经被作者于2017/6/22 13:15:33编辑过]