msgboxに値を表示するにはどうすればよいですか? DataGridの最初の列では、テキストボックスに基づいて値を探しています.2番目の列の値とmsgboxの同じ行が表示されます。今、私はあなたがFor Each
経由で直接List2DataGridView.Rows
を列挙することができテキストボックスの値を使用してDataGridで検索
Private Sub PictureBox12_Click(sender As Object, e As EventArgs) Handles PictureBox12.Click
Dim temp As Integer = 0
For i As Integer = 0 To List2DataGridView.RowCount - 1
For j As Integer = 0 To List2DataGridView.ColumnCount - 1
If List2DataGridView.Rows(i).Cells(j).Value.ToString = TextBox2.Text Then
MsgBox("Intem found")
temp = 1
End If
Next
Next
If temp = 0 Then
MsgBox("Item not found")
End If
End Sub
あなたが何か質問に答えたときに親切に説明してください。 –
@manuこれを編集してコードを説明し、わかりやすいバージョンを提供しました。質問に答えるかどうかわかりませんが、質問の意図が不明なので –