Here some code about something i seem not to get working...
1) first part is a class and it works
2) button1 works
3) why doenst allow me to retrieve the value of the list i made like bakjeList.count?
It says BakjeList is not declared.. etc, but how to declare it right?
Code:Public Class Class_BaanAsBakje REM ************************************************ REM * Fields voor de bakjes van de baan REM ************************************************ Private mXlineBakje As Single Private mYlineBakje As Single Private mWaarde As Single REM ************************************************ REM * Properties voor de bakjes van de baan REM ************************************************ Public Property XlineBakje As Single Get Return mXlineBakje End Get Set(ByVal value As Single) mXlineBakje = value End Set End Property Public Property YlineBakje As Single Get Return mYlineBakje End Get Set(ByVal value As Single) mYlineBakje = value End Set End Property Public Property Waarde As Single Get Return mWaarde End Get Set(ByVal value As Single) mWaarde = value End Set End Property Public Sub New(ByVal xlineBakje As Single, ByVal ylinebakje As Single, ByVal waarde As Single) mXlineBakje = xlineBakje mYlineBakje = ylinebakje mWaarde = waarde End Sub End ClassCode:Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim bakjesList As New List(Of Class_BaanAsBakje) bakjesList.Clear() ListBox1.Items.Clear() For i = 0 To 100 Dim bakje As Class_BaanAsBakje = New Class_BaanAsBakje(i, i + 1, i + 3) bakjesList.Add(bakje) ListBox1.Items.Add(bakje.XlineBakje & " " & bakje.YlineBakje & " " & bakje.Waarde) Next Dim test As Integer test = bakjesList.Count() bakjesList.RemoveAt(5) For i = 0 To bakjesList.Count - 1 ListBox1.Items.Add(bakjesList(i).XlineBakje & " " & bakjesList(i).YlineBakje & " " & bakjesList(i).Waarde) Next End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ' Dim bakjesList As List(Of Class_BaanAsBakje) Dim test2 As Integer test2 = bakjesList.Count() End Sub End Class


Reply With Quote
Bookmarks