Emily Martin
Emily Martin

Reputation: 19

Can I change the default cursor to a wait cursor for a set position within the form.design? C#

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

Answers (1)

Sweeper
Sweeper

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

Related Questions