MSHFlexGrid控件问题。小妹及用,请各位大哥哥帮帮忙。

370602800831432 2002-10-30 09:49:04
rec.Open ssql, conn, adOpenKeyset, adLockOptimistic, adCmdText
If Not rec.EOF Then
Set MSHFlexGrid1.DataSource = rec
Jd = DatePart("m", Now) - 1
TMonth = CStr(Jd) & "-26"
zc = DatePart("ww", TMonth)
For i = 1 To MSHFlexGrid1.Rows - 1

MSHFlexGrid1.TextMatrix(i, 0) = Val(MSHFlexGrid1.TextMatrix(i, 0)) - zc + 1

Select Case Me.MSHFlexGrid1.TextMatrix(i, 0)
Case 1
Me.Picture1.CurrentX = 5150 * 0.5
Me.Picture1.CurrentY = 6500 * 0.5
Me.Picture1.Print (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
yf1 = (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
Case 2
Me.Picture1.CurrentX = 5650 * 0.5
Me.Picture1.CurrentY = 6500 * 0.5
Me.Picture1.Print (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
yf2 = (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
Case 3
Me.Picture1.CurrentX = 6150 * 0.5
Me.Picture1.CurrentY = 6500 * 0.5
Me.Picture1.Print (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
yf3 = (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
Case 4
Me.Picture1.CurrentX = 6650 * 0.5
Me.Picture1.CurrentY = 6500 * 0.5
Me.Picture1.Print (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
yf4 = (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
Case 5
Me.Picture1.CurrentX = 7150 * 0.5
Me.Picture1.CurrentY = 6500 * 0.5
Me.Picture1.Print (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
yf5 = (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
End Select

Next

End If
rec.Close
这段代码在运行的时候只要。msh1和MSH5的行数不一样。或都MSH5为空。就会出错。我相请各位大哥哥帮帮忙怎样让msh1 和MSH5的行数都固定为6行。小妹急用。请各位大哥哥,一定帮帮小妹。
...全文
9 点赞 收藏 1
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
fling_boy 2002-10-30
msh1的行数是由返回的记录集决定的,msh5的行数你没有明确说明。
如果想让两个都是6行,你可以在for循环前加上
msh1.rows=6
msh5.rows=6
我不明白你的程序是做什么的,还有你写的代码也太不规范了,以后要把这个写好点。看着都头晕。
回复
相关推荐
发帖
VB基础类
创建于2007-09-28

7489

社区成员

VB 基础类
申请成为版主
帖子事件
创建了帖子
2002-10-30 09:49
社区公告
暂无公告