Private Sub Form_Load() Dim I As Integer With MSFlexGrid1 .Clear .Cols = 3 .Rows = 10 For I = 0 To 9 .TextMatrix(I, 0) = I + 1 Next End With End Sub不知这样算不算自动的了。^_^
Private Sub Form_Load() dim i as integer With mshflexgrid1(6) .Rows = 151 For i = 1 To 150 .TextArray(Fgi6(i, 0)) = i Next end with end subFunction Fgi(r As Integer, c As Integer) As Integer Fgi = c + mshflexgrid1.Cols * r End Function
是啊,要什么样的答案? Private Sub MSFlexGrid_Show() Dim i As Integer With MSFlexGrid1 .Cols = 7 .ColWidth(0) = 800 .TextMatrix(0, 0) = "序号" .ColWidth(1) = 2800 .TextMatrix(0, 1) = "条码" .ColWidth(2) = 5200 .TextMatrix(0, 2) = "名称" ...... For i = 1 To .Rows - 1 .TextMatrix(i, 0) = i Next i End With End Sub
Dim I As Integer
With MSFlexGrid1
.Clear
.Cols = 3
.Rows = 10
For I = 0 To 9
.TextMatrix(I, 0) = I + 1
Next
End With
End Sub不知这样算不算自动的了。^_^
dim i as integer
With mshflexgrid1(6)
.Rows = 151
For i = 1 To 150
.TextArray(Fgi6(i, 0)) = i
Next
end with
end subFunction Fgi(r As Integer, c As Integer) As Integer
Fgi = c + mshflexgrid1.Cols * r
End Function
Private Sub MSFlexGrid_Show()
Dim i As Integer
With MSFlexGrid1
.Cols = 7
.ColWidth(0) = 800
.TextMatrix(0, 0) = "序号"
.ColWidth(1) = 2800
.TextMatrix(0, 1) = "条码"
.ColWidth(2) = 5200
.TextMatrix(0, 2) = "名称"
......
For i = 1 To .Rows - 1
.TextMatrix(i, 0) = i
Next i
End With
End Sub
msglist.TextMatrix(0,0)让他自动编号 和
让列表每各一行显示不同的颜色我该怎么办呢??求源代码!谢谢!
.CellBackColor :当前单元格背景色
把当前记录插到临时表,建一个Indentity字段,然后Select *
select * into #tmptabel from 你的表 插入到临时表
alter table #tmptabel add 你的编号列名 [bigint] IDENTITY (1, 1) 插入临时表自动编号列
select * from #tmptabel 获取记录
记得用完后关闭