C# Creating a Custom Mouse Cursor
This is surprisingly easy to do. To create a cursor from an image resource:
Cursor cursor = new Cursor(Properties.Resources.add.GetHicon());
this.Cursor = cursor;
To create a cursor from any graphic:
Bitmap bmp = new Bitmap(55, 25);
Graphics g = Graphics.FromImage(bmp);
g.DrawString(“Hello World!”, this.Font, Brushes.Blue, 0, 0);
Cursor cursor = new Cursor(bmp.GetHicon());
this.Cursor = cursor;
本文介绍如何使用 C# 创建自定义鼠标光标。包括从图像资源创建光标及如何从任何图形创建光标的方法。
2万+

被折叠的 条评论
为什么被折叠?



