Here's an example:
public MainForm()
{
InitializeComponent();
LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0,0,100,100),Color.Blue, Color.White,angle:0);
brush.WrapMode = WrapMode.Tile; // OK
brush.WrapMode = WrapMode.Clamp; // Causes Unhandled exception alert, offering break
}
In the VS2008 output window this shows:
A first chance exception of type 'System.ArgumentException' occurred in System.Drawing.dll Additional information: Parameter is not valid.
(pic https://i.stack.imgur.com/51a43.png)
This is on Windows 7.
Documentation here https://msdn.microsoft.com/en-us/library/vstudio/system.drawing.drawing2d.lineargradientbrush.wrapmode(v=vs.90).aspx
confirms LinearGradientBrush.WrapMode accepts a WrapMode
"Gets or sets a WrapMode enumeration that indicates the wrap mode for this LinearGradientBrush."
and this https://msdn.microsoft.com/en-us/library/vstudio/system.drawing.drawing2d.wrapmode(v=vs.90).aspx
confirms that WrapMode.Clamp is valid for gradient:
"Clamp The texture or gradient is not tiled."