Call Project Progressbar winforms in test project in the same Software

Asked

Viewed 27 times

-1

Friends, I have 2 projects in the same Software, 1 of these codedUI and another with winform containing a simple progress bar. It was carried out the import in the test project of the reference and instantiated the same one where would like to call. The problem is that when calling the method that increments the bar value it is not displayed. That is, the communication happens but the bar is not displayed. I would like contributions for the bar call to be displayed at the time the tests are being debugged. Progress bar:

namespace ProgressBar Form1
{
    public partial class ProgressBar : Form
    {
        public ProgressBar()
        {
            InitializeComponent();
        }

        public void progressBar1_Value()
        {

                progressBar1.Value += 10;

        }

        public void show()
        {

            progressBar1.Show();


        }


    }
}

Call the bar on the test:

using projeto = ProgressBar;
projeto.ProgressBar Barra = new projeto.ProgressBar();
            for (int i = 0; i < 9; i++)
            {
                Barra.progressBar1_Value();
                Barra.show();
            }

1 answer

1

Personal talk,

I was able to identify what was missing in the code. Strangely, "Barra.Show" only worked after cleaning and rebuilding the project. The solution clean/Rebuild the progress bar created in a winform project. But the call is this, the show() method that displays the bar.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.