Displaying the results
We'll take a look at whether this works momentarily. So, with the code in place, once we have them generated, of course, we can display them. Enter the following below the closing curly braces below the foreach
loop:
foreach (Point p in points)
Now enter the following within a set of curly braces below the foreach
line. After typing sampLabel.Text
, you want to make use of the properties that you have, so you're going to show Point
as you would see it in a book, using parentheses. Also, when you type p
. (dot), notice the property shows up in a pop-up list; select X
:
sampLabel.Text += $"({p.X},{p.Y})";