เรื่องมันมีอยู่ว่า ผมจะ select ข้อมูลใน listview ตามColumn Head ที่สร้างไว้
Code (VB.NET)
Private Sub cmdSelect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSelect.Click
txtCode.Text = ListView1.FocusedItem.Text
txtDesc.Text = ListView1.FocusedItem.SubItems(1).Text
cboRef.Text = ListView1.FocusedItem.SubItems(2).Text
cboAcc1.Text = ListView1.FocusedItem.SubItems(3).Text
cboAcc2.Text = ListView1.FocusedItem.SubItems(4).Text
cboAcc3.Text = ListView1.FocusedItem.SubItems(5).Text
If Trim(ListView1.FocusedItem.SubItems(6).Text) = "" Then
cboAcc4.SelectedIndex = -1
Else
cboAcc4.Text = ListView1.FocusedItem.SubItems(6).Text
End If
End sub