Question: I have an overriden (WinForms) MemoEdit control (unfortunately I can't give you the code).
If I enter more than 32000 characters, it raises an error "A generic error occurred in GDI+"
I thought that there's an error (exception) in my control but then I tested on a simple WinForm application this code:

```
var myString = new string('G', 32001);
var g = this.CreateGraphics();
g.MeasureString(myString, Font, 1000);

```

and it crashes with the same exactly error
Does anyone know why this happens or where is specified this constant of 32000 ? I couldn't find anything useful on Google.

Answer: 
This seems to be a new bug which was introduced in Windows 8. I would be curious as to the behaviour in an older version of Windows:

<https://connect.microsoft.com/VisualStudio/feedback/details/776722/label-control-throws-an-exception-if-its-text-is-set-to-a-very-long-string>
It could be possible that the string width exceeds Int32.Max (you could maybe refer to [this thread](http://www.telerik.com/forums/gdi-error-in-system-drawing-graphics-measurestring)).

I know that your error occures if you use a language as Arabic which involves special characters (see [MSDN-Link](https://msdn.microsoft.com/en-us/library/windows/desktop/ms535829%28v=vs.85%29.aspx): `For bidirectional languages, such as Arabic, the string length must not exceed 2046 characters`).

To solve your problem I would suggest splitting the string every 31999th character and add the different sizes/lengths.