是否可以在 vb.net 中自动调整表单窗口的大小以将其宽度更改为 datagridview 宽度?
我一直在寻找一段时间,但只能找到如何调整 datagridview 本身的大小。
这是准备 Datagridview 的代码
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim rowvalue As String Dim cellvalue(20) As String
Dim streamReader As IO.StreamReader = New IO.StreamReader("test.csv")
While streamReader.Peek() <> -1
rowValue = streamReader.ReadLine()
cellvalue = rowvalue.Split(","c)
DataGridView1.Rows.Add(cellValue)
End While
streamReader.Close()
End Sub
谢谢,