[VB6] ListItem, SubItem 둘다 1부터 시작한다.
Set ItemX = frmMain.lvwUser.ListItems.Add(1, , txtUserID)
ItemX.SubItems(1) = txtUserName
[VB.NET] ListItem, SubItem 둘다 1부터 시작한다.
주의점→SubItems(0)는 VB6에서의 SubItems(1)가 아니라 ListItem에 해당한다. SubItems(0)을 수정하면 ListItem이 수정됨.
ListItem은 0→1로부터 SubItem은 1→1 로 시작변수가 변경되었다고 생각하면 편함
ItemX = frmMain.lvwUser.Items.Insert(0, txtUserID.Text)
If ItemX.SubItems.Count > 0 Then
ItemX.SubItems(0).Text = txtUserName.Text
Else
ItemX.SubItems.Insert(0, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, txtUserName.Text))
End If
Set ItemX = frmMain.lvwUser.ListItems.Add(1, , txtUserID)
ItemX.SubItems(1) = txtUserName
[VB.NET] ListItem, SubItem 둘다 1부터 시작한다.
주의점→SubItems(0)는 VB6에서의 SubItems(1)가 아니라 ListItem에 해당한다. SubItems(0)을 수정하면 ListItem이 수정됨.
ListItem은 0→1로부터 SubItem은 1→1 로 시작변수가 변경되었다고 생각하면 편함
ItemX = frmMain.lvwUser.Items.Insert(0, txtUserID.Text)
If ItemX.SubItems.Count > 0 Then
ItemX.SubItems(0).Text = txtUserName.Text
Else
ItemX.SubItems.Insert(0, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, txtUserName.Text))
End If
'개발 > .Net' 카테고리의 다른 글
[VB6→VB.NET] 문자열 형식 변경(Format) (0) | 2011.01.21 |
---|---|
[VB6→VB.NET] 구조체 안에 배열선언 (0) | 2011.01.20 |
[VB6→VB.NET] 사이즈 단위 변화 (Height, Width→Size / Left, Top→Location) (0) | 2011.01.05 |
[VB.NET] ComboBox (0) | 2010.12.17 |
[VB.NET] 픽쳐박스에 이미지파일을 표시후 바로 삭제하는 방법 (0) | 2010.12.17 |
[VB.NET] Form 명령어 (0) | 2010.12.16 |
[VB6→VB.NET] 배경색 변경 (0) | 2010.12.16 |
[VB6→VB.NET] 문자열 변환 (0) | 2010.12.16 |
[VB6→VB.NET] TreeView (0) | 2010.12.16 |
[VB6] 엑셀파일 DB Import (0) | 2010.08.18 |