Show Working message until method is executed Rad Windows Form

2 posts, 0 answers
  1. Sanjaya Kodagoda
    Sanjaya Kodagoda avatar
    10 posts
    Member since:
    Mar 2006

    Posted 30 Jun 2014 Link to this post

    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
  2. George
    Admin
    George avatar
    500 posts

    Posted 01 Jul 2014 Link to this post

    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.
     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top