[Tip: cursor bitmap]

 How to create a custom mouse cursor?

// create any bitmap
Bitmap b = new Bitmap( 55, 25 );
Graphics g = Graphics.FromImage ( b );
// do whatever you wish
g.DrawString ( "myText", this.Font, Brushes.Blue, 0, 0 );
// this is the trick!
IntPtr ptr = b.GetHicon();
Cursor c = new Cursor( ptr );
// attach cursor to the form
this.Cursor = c;

posted @ 2010-03-29 17:53  能巴  阅读(136)  评论(0编辑  收藏  举报