Reputation: 19
I am new to using C# and I am wondering if there is a method for changing the cursor to a wait cursor for a specific area within the Form window.
In my case I would like the cursor to change to the wait cursor when it is processing data and the cursor is positioned over the Text Box output.
Is this at all possible?
Regards, Emily
Upvotes: 2
Views: 106
Reputation: 271355
If your "specific area" is covered by a control, you can just set that control's Cursor
property to Cursors.WaitCursor
. In your case it seems like you have a TextBox
:
yourTextBox.Cursor = Cursors.WaitCursor;
Otherwise, add a new control the the form:
var control = new Control();
// use the Location and Size properties to define your "area'
control.Location = ...;
control.Size = ...;
// set the cursor
control.Cursor = Cursors.WaitCursor;
yourForm.Controls.Add(control);
Upvotes: 1