Vysakh
Vysakh

Reputation: 223

Progress indicator in C# Winforms

I have created some basic applications using windows forms C#.

What I am trying to achieve is that I have some task taking place inside a function. While executing that task I need to display a message box (with no buttons) with the text "Configuring...". I also need to blink this text. How can I do that?

Do I need to have another form for this? After completing this task this form needs to be hidden or closed?

I have googled this but couldn't see an answer, may be because of my unclear question in google.

Upvotes: 0

Views: 11842

Answers (2)

RdPC
RdPC

Reputation: 689

If you really need a progress indicator you have to do as toATwork said, and do a Background worker However, it is not a really async task, so you might find it hard to make it work properly

If you finally don't care about the message, and just need to show the users that something is happening, you can always use:

// To start
Cursor cursor = Cursor.Current;
Cursor.Current = Cursors.WaitCursor;

// To finish
Cursor.Current = Cursors.Default;

This will just put the mouse cursor in "loading", but it might work for you

Upvotes: -1

AHMAD SUMRAIZ
AHMAD SUMRAIZ

Reputation: 531

You can use a label on your form and change its text in function Body.

{
//your function body
label.Text="Configuring";
}

Upvotes: -3

Related Questions