vb MSFlexGrid控件编写表格初始化
发布网友
发布时间:2023-01-03 08:20
我来回答
共1个回答
热心网友
时间:2023-06-28 10:40
有两个关键地方,看一下代码
Public Sub tabint()
Grid.Cols = 10
Grid.Rows = 8 + 1
For i = 0 To 8
Grid.Row = n: Grid.Text = ""
Grid.ColWidth(i) = 1200 '(定制宽度是这样定的)
Next i '(for循环,你少了一个i)
Grid.Row = 0
Grid.Col = 0: Grid.Text = "序号"
Grid.Col = 1: Grid.Text = "电机转速"
Grid.Col = 2: Grid.Text = "风速1"
Grid.Col = 3: Grid.Text = "风速2"
Grid.Col = 4: Grid.Text = "风速3"
Grid.Col = 5: Grid.Text = "平均风速"
Grid.Col = 6: Grid.Text = "压力差1"
Grid.Col = 7: Grid.Text = "压力差2"
Grid.Col = 8: Grid.Text = "压力差3"
Grid.Col = 9: Grid.Text = "平均压力差"
Grid.TopRow = 1
Grid.LeftCol = 1
End Sub
你那样也行,调试一下可以就行了。不过我看你的代码,也学到了一些。原来next后面不接i或j也行啊。高!