C
C#2y ago
JoddYt

❔ how do i make a button that changes the current windows mouse cursor? (not only in winform)

using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace PointerX
{

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void guna2Button1_Click(object sender, EventArgs e)
{
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
this.Cursor = new Cursor("SlySpyOriginal.cur");
}
}
}
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace PointerX
{

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void guna2Button1_Click(object sender, EventArgs e)
{
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
this.Cursor = new Cursor("SlySpyOriginal.cur");
}
}
}
i have made this but it only changes the cursor for like 0.1 second
11 Replies
Binto86
Binto862y ago
the cursor changes back when you get out of the form? or what is the problem
JoddYt
JoddYtOP2y ago
when i click button, the cursor changes to the other cursor which i uploaded to vs and changes back to the before cursor
JoddYt
JoddYtOP2y ago
JoddYt
JoddYtOP2y ago
here i recorded a bit @Binto86
Binto86
Binto862y ago
i see hmm thats weird, the code looks ok is there any other code in the app or not?
JoddYt
JoddYtOP2y ago
nope only this one can it be somethin with settings?
Binto86
Binto862y ago
possibly tbh i dont know maybe try Cursor.Current = new Cursor(...)
JoddYt
JoddYtOP2y ago
same thing ;d
Binto86
Binto862y ago
than idk sory
amio
amio2y ago
Changing the cursor "outside of" your application is likely to be some system/windows API call and it might not have an API directly in .NET
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server