以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  表样式设计出错  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=174522)

--  作者:yifan3429
--  发布时间:2022/1/19 15:33:00
--  表样式设计出错
For Each c As WinForm.Control In e.Form.Controls
    If Typeof c Is WinForm.Table Then \'判断控件是否是文本框
        Dim dt As WinForm.Table = c \'使用特定类型的变量引用控件
        dt.Table.ListMode = True  \'突出选定行
        \'MessageBox.Show(1)
        dt.Font = New Font("宋体",9,FontStyle.Regular)
        dt.Table.Grid.Styles("Normal").Border.Color = Color.DeepSkyBlue   \'当前表格边线色
        dt.Table.DataTable.SysStyles("CurrentRow").BackColor = Color.DeepSkyBlue
        dt.Table.DataTable.SysStyles("EmptyArea").BackColor = Color.White  \'当前表空白区背景色
        
        
        dt.Table.Cols.TextAlign = TextAlignEnum.Center  \'当前表数据居中
        dt.Table.Cols.TextAlignFixed = TextAlignEnum.Center \'当前表标题居中
        
        
        \'MessageBox.Show(2)
        dt.Table.ExtendLastCol = True    \'当前表自动调整列宽
        
        \'Tables("订单").Cols("数量").Width = 150  \'当前表指定列的宽度
        \'MessageBox.Show(3)
        dt.Table.DefaultRowHeight = 25   \'当前表自动固定行高
        \'MessageBox.Show(4)
    End If
Next

--  作者:有点蓝
--  发布时间:2022/1/19 15:52:00
--  
需要指定列:http://www.foxtable.com/webhelp/topics/1786.htm

dt.Table.Cols("xx列").TextAlign = TextAlignEnum.Center 

--  作者:yifan3429
--  发布时间:2022/1/19 16:27:00
--  
所有列不行吗
--  作者:有点蓝
--  发布时间:2022/1/19 16:49:00
--  
遍历所有列,一个个设置