16,717
社区成员
发帖
与我相关
我的任务
分享
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
DataGridView1.Rows(0).Cells(3).Value = 1
DataGridView1.Rows(1).Cells(3).Value = 2
DataGridView1.Rows(2).Cells(3).Value = 3
DataGridView1.Rows(3).Cells(3).Value = 4
DataGridView1.Rows(4).Cells(3).Value = 5
DataGridView1.Rows(5).Cells(3).Value = 6
DataGridView1.Rows(6).Cells(3).Value = 7
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataGridView1.ColumnCount = 4
' Set the column header style.
' Set the column header names.
DataGridView1.Columns(0).Name = "Recipe"
DataGridView1.Columns(1).Name = "Category"
DataGridView1.Columns(2).Name = "thirdColumnHeader"
DataGridView1.Columns(3).Name = "Rating"
' Populate the rows.
Dim row1 As String() = New String() _
{"Meatloaf", "Main Dish", "boringMeatloaf", "boringMeatloafRanking"}
Dim row2 As String() = New String() {"Key Lime Pie", "Dessert", "lime juice, evaporated milk", "****"}
Dim row3 As String() = New String() _
{"Orange-Salsa Pork Chops", "Main Dish", "pork chops, salsa, orange juice", "****"}
Dim row4 As String() = New String() _
{"Black Bean and Rice Salad", "Salad", "black beans, brown rice", "****"}
Dim row5 As String() = New String() _
{"Chocolate Cheesecake", "Dessert", "cream cheese", "***"}
Dim row6 As String() = New String() {"Black Bean Dip", "Appetizer", "black beans, sour cream", "***"}
Dim rows As Object() = New Object() {row1, row2, row3, row4, row5, row6}
Dim rowArray As String()
For Each rowArray In rows
DataGridView1.Rows.Add(rowArray)
Next
'PostRowCreation()
'shortMode = False
'boringRecipe = True
End Sub
End Class