Is there any easy way to change default cursors in windows forms?
e.g. I want to change Cursors.SizeWE
to a custom cursor.
Currently using a dirty hack like that:
// https://github.com/dotnet/winforms/blob/07a7823865ef0409f34af626f75718c33b246781/src/System.Windows.Forms/src/System/Windows/Forms/Cursors.cs#L14
var propertyInfo = typeof(Cursors).GetField("s_sizeWE", BindingFlags.NonPublic | BindingFlags.Static);
propertyInfo.SetValue(null, myCustomSizeWEcursor);
I also tried changing it in CursorChanged
event but it was glitchy and the old cursor was still visible sometimes.
I don't get why it's read-only btw.