A
Ash Phillips
Hi Everyone,
I have this program I wrote in VB6 for family use. It's a DVD Database just
for me to keep track of them cause I have so many lol.
In VB6, I could add items to the ListView in 'frmMain' from 'frmAdd' with
the following code:
Private Function AddEntry(Title As String, Rating As String, Genre As
String, OnLoan As Boolean, ToWho As String)
Dim x As ListItem
Set x = frmMain.lvwDVD.ListItems.Add(, , Title, , 1)
x.SubItems(1) = Rating
x.SubItems(2) = Genre
If OnLoan = True Then
x.SubItems(3) = "Yes"
Else
x.SubItems(3) = "No"
End If
x.SubItems(4) = ToWho
frmMain.lvwDVD.SelectedItem = x
End Function
The ListView I use in VB6 is from COMCTL.OCX
Now in VB .NET I have the following:
Private Function AddEntry(ByVal Title As String, ByVal Rating As String,
ByVal Genre As String, ByVal OnLoan As Boolean, ByVal ToWho As String)
Dim frmMain As New frmMain
Dim X As ListViewItem
X = frmmain.lvwDVD.Items.Add(Title)
X.SubItems(1).Text = Rating
X.SubItems(2).Text = Genre
If OnLoan = True Then
X.SubItems(3).Text = "Yes"
Else
X.SubItems(3).Text = "No"
End If
X.SubItems(4).Text = ToWho
End Function
The ListView I use in VB .NET is the System.Windows.Forms.ListView (I
believe)
In VB6, 'frmAdd' would be shown modal above 'frmMain' and the function would
add the item succesfully to the ListView.
For the life of me I can't make this happen in VB .NET
Is it at all possible?
Thanks in advance,
Ash
I have this program I wrote in VB6 for family use. It's a DVD Database just
for me to keep track of them cause I have so many lol.
In VB6, I could add items to the ListView in 'frmMain' from 'frmAdd' with
the following code:
Private Function AddEntry(Title As String, Rating As String, Genre As
String, OnLoan As Boolean, ToWho As String)
Dim x As ListItem
Set x = frmMain.lvwDVD.ListItems.Add(, , Title, , 1)
x.SubItems(1) = Rating
x.SubItems(2) = Genre
If OnLoan = True Then
x.SubItems(3) = "Yes"
Else
x.SubItems(3) = "No"
End If
x.SubItems(4) = ToWho
frmMain.lvwDVD.SelectedItem = x
End Function
The ListView I use in VB6 is from COMCTL.OCX
Now in VB .NET I have the following:
Private Function AddEntry(ByVal Title As String, ByVal Rating As String,
ByVal Genre As String, ByVal OnLoan As Boolean, ByVal ToWho As String)
Dim frmMain As New frmMain
Dim X As ListViewItem
X = frmmain.lvwDVD.Items.Add(Title)
X.SubItems(1).Text = Rating
X.SubItems(2).Text = Genre
If OnLoan = True Then
X.SubItems(3).Text = "Yes"
Else
X.SubItems(3).Text = "No"
End If
X.SubItems(4).Text = ToWho
End Function
The ListView I use in VB .NET is the System.Windows.Forms.ListView (I
believe)
In VB6, 'frmAdd' would be shown modal above 'frmMain' and the function would
add the item succesfully to the ListView.
For the life of me I can't make this happen in VB .NET
Is it at all possible?
Thanks in advance,
Ash