Linq and Points

I'm looking for a way to use Linq to return the maximum X value from a list(Of Point)
Who is Participating?
Carl TawnConnect With a Mentor Systems and Integration DeveloperCommented:
Try something like:
            List<System.Drawing.Point> list = new List<System.Drawing.Point>()
                new System.Drawing.Point(10, 3),
                new System.Drawing.Point(5, 4),
                new System.Drawing.Point(12, 2)

            var point = (from p in list
                        orderby p.X descending
                        select p).First();

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.