This is a migrated thread and some comments may be shown as answers.

Show Working message until method is executed Rad Windows Form

1 Answer 30 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sanjaya Kodagoda
Top achievements
Rank 1
Sanjaya Kodagoda asked on 01 Jul 2014, 04:00 AM
I want to show waiting message or working message until my method executed. I tried with RadWaitingBar. But its not started as I am expecting. Here is my code.
try
                {
                    WaitingBar(true);
                    Save();
                    WaitingBar(false);
                }
                catch (Exception)
                {
                    WaitingBar(false);
                    RadMessageBox.Show("Error Occured");
                    throw;
                }

private void WaitingBar(bool input)
        {
            if (input == true)
            {
                radWaitingBar1.Visible = true;
                radWaitingBar1.StartWaiting();
                radWaitingBar1.Invalidate();
                radWaitingBar1.Update();
                radWaitingBar1.Refresh();
                Application.DoEvents();
            }
            else
            {
                radWaitingBar1.Visible = false;
                radWaitingBar1.StopWaiting();
            }
        }

Can we lock Rad Windows form until my method finished and show some animation?
Thanks

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 01 Jul 2014, 08:15 AM
Hi Sanjaya,

Thank you for writing.

I am not sure what the problem is in your case since the provided information is insufficient for me to investigate properly. You can read the article: Using WaitingBar with a Background Worker | UI for WinForms Documentation it will show you the general approach of reporting a long running operation. I would also suggest you not to use Application.DoEvents since it may cause issues with our layouts due to their asynchronous nature. 

If you require further assistance I would like to kindly ask you to provide me with some additional details about your case.

Looking forward to your reply.

Regards,
George
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
General Discussions
Asked by
Sanjaya Kodagoda
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or