VB中的DataGridView中的添加行和列是否有任何建议
到目前为止,这是可能的代码,
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
Dim tab As Integer = TextBox1.Text
Dim row As Integer = TextBox2.Text
Dim i, j As Integer
DataGridView1.ColumnCount = tab
Dim q As Integer = 0
For i = 1 To tab
DataGridView1.Columns(q).Name = ""
For j = 1 To row
DataGridView1.Rows().Add({i & "x" & j & "=" & (i * j)})
Next j
Next i
End Sub
我收到的输出就是这样: 在此处输入图像描述
This is may code so far
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
Dim tab As Integer = TextBox1.Text
Dim row As Integer = TextBox2.Text
Dim i, j As Integer
DataGridView1.ColumnCount = tab
Dim q As Integer = 0
For i = 1 To tab
DataGridView1.Columns(q).Name = ""
For j = 1 To row
DataGridView1.Rows().Add({i & "x" & j & "=" & (i * j)})
Next j
Next i
End Sub
the output i get was like this :
enter image description here
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题不清楚,但是从我在评论中阅读的内容中,您应该问如何在DataGridView中添加1x1至1x4。如果是这样,您只需要向上滚动即可查看它或尝试放大数据杂志,对不起,如果我错误的解释。
the question is not clear, but from what I read in the comment you should be asking how to add the 1x1 to 1x4 in the datagridview. If so then you only need to scroll up to see it or try enlarging your datagridview, sorry if i interpret wrongly.