使用文件 vb6 填充 flexgrid
所以我需要将文件中的所有名称放入 flexgird 上的第 1 列中,每个名称应该放在自己的行上。这是我所拥有的,但我只是得到“无效的行值”
namefile = App.Path & "\names.dat" Open namefile For Input As #1 While Not EOF(1) Input #1, x With MSFlexGrid1 .Col = 1 .Rows = rowcount + 1 .Text = x End With Wend End Sub
任何帮助都会很棒,并提前致谢
So I need to put all the names in a file into column 1 on flexgird, each name should go on its own row. here is what I have but i just get "invalid row value"
namefile = App.Path & "\names.dat" Open namefile For Input As #1 While Not EOF(1) Input #1, x With MSFlexGrid1 .Col = 1 .Rows = rowcount + 1 .Text = x End With Wend End Sub
Any help would be fantastic and thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定为什么 rowcount 出现在您的示例代码中,但这对我有用
我还将
.Col =1
从循环中取出 - 您不需要继续设置它并且你的循环会比没有它更快(不是很多,但重复设置它是没有意义的)I'm not sure why rowcount is in your example code, but this works for me
I've also pulled the
.Col =1
out of your loop - you don't need to keep setting it and your loop will be faster than without it (not by much but repeatedly setting it is pointless)如何将 Recordset 的内容转储到 Flexgrid 中。
加载任何内容后是记录集,本文提供了有关您想要使用网格执行的各种操作的技术。
How to dump contents of the Recordset into a Flexgrid.
Once you load whatever it is into a recordset, this article provides techniques on various things you'll want to do with the grid.