Hello!
This is the first time I am using a list in code. (Still a beginner...) But anyway, something's not right. I created a list of points, and added one to the list, but how can you tell if a list contains that point? I thought List.Contains() could work, but I guess not. Nothing happens when I load up the form. What am I doing wrong? How can I tell if a list contains a point or not?
Thanks!
vb Code:
Public Class Form1 Dim PointsList As List(Of Point) Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Dim TestPoint1 As Point = New Point(0, 0) Dim TestPoint2 As Point = New Point(0, 0) PointsList.Add(TestPoint1) If PointsList.Contains(TestPoint2) Then Label1.Text = "It worked!" End If End Sub End Class




Reply With Quote
