Tag Archives: minimum

Let the user select the ScrollBar maximum in C#

You would think that allowing the user to select the ScrollBar maximum would be the default behavior. Unfortunately, that’s not the case. The behavior of the VScrollBar and HScrollBar controls is largely determined by their Value, Minimum, Maximum, SmallChange, and … Continue reading

Posted in controls | Tagged , , , , , , , , , , , , , , , , | 2 Comments

Make generic Min and Max methods in C#

This example shows how you can make generic Min and Max methods to find the minimum and maximum values in a sequence of parameters. The Math namespace’s Min and Max methods are very useful, but they have two big drawbacks. … Continue reading

Posted in algorithms, arrays, calculations, generic, methods | Tagged , , , , , , , , , , , , , , | Leave a comment

Use LINQ to find a bounding box for a list of PointF in C#

This example shows how to use LINQ to find a bounding box for a list of PointF. When you click on the program’s PictureBox, it adds points to the list and shows the bounding box. The following method finds the … Continue reading

Posted in graphics, LINQ | Tagged , , , , , , , , , , , | Leave a comment

Use LINQ Min, Max, and Average extension methods in C#

This example shows how to use LINQ Min, Max, and Average extension methods to get the minimum, maximum, and average values from an array. In order to support LINQ, Microsoft added those extension methods and others. LINQ includes several useful … Continue reading

Posted in extension methods, LINQ, mathematics | Tagged , , , , , , , , , , , , | Leave a comment