圖片轉(zhuǎn)換為鼠標(biāo)光標(biāo)代碼如下:
private void Form1_Load(object sender, EventArgs e)
{
//button1.Cursor = System.Windows.Forms.Cursors.Hand;
Bitmap bmp = new Bitmap("780.jpg");
Cursor cursor = new Cursor(bmp.GetHicon());
button1.Cursor = cursor;
}
注意事項(xiàng):圖片盡量使用png格式(支持透明)?
參考
如何管理鼠標(biāo)指針 - Windows Forms .NET | Microsoft Learnhttps://learn.microsoft.com/zh-cn/dotnet/desktop/winforms/input-mouse/how-to-manage-cursor-pointer?view=netdesktop-8.0
特此記錄
anlog文章來源:http://www.zghlxwxcb.cn/news/detail-819480.html
2024年1月10日文章來源地址http://www.zghlxwxcb.cn/news/detail-819480.html
到了這里,關(guān)于c#圖片作為鼠標(biāo)光標(biāo)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!