Kavitha
Kavitha

Reputation: 1467

Progressbar in windows application

I am importing xml document to econnect method(Microsoft Dynamic GP). it is taking few minutes(10 M) to import the file. so i need to show progress bar while doing import.

In form load event I am submitting xml file.

But problem is form is showing after submit the xml file. I need to show the Progressbar form (70%) before sumbiting xml file. And submiting xml file i have to show progress bar full (100%).

Let me know how can i show.....

              Form BarFormobj = new Form();
                BarFormobj.Width = 250;
                BarFormobj.Height = 150;
                BarFormobj.StartPosition = FormStartPosition.Manual;
                BarFormobj.Location = new Point(450, 200);
                BarFormobj.Text = "Invoice Date";

                BarFormobj.Load += new EventHandler(BarFormobj_Load);                    
                pBar.Location = new System.Drawing.Point(20, 20);
                pBar.Name = "progressBar1";
                pBar.Width = 200;
                pBar.Height = 30;

                pBar.Minimum = 0;
                pBar.Maximum = 100;
                pBar.Value = 70;   
                BarFormobj.Controls.Add(pBar);

                BarFormobj.ShowDialog();

                    pBar.Value = 100;
                    BarFormobj.Controls.Add(pBar);

              MessageBox.Show("Invoices have been successfully created");

static void BarFormobj_Load(object sender, EventArgs e)

    {          

      eConcall.CreateTransactionEntity(connStr, xmlDoc);  // here i am submitting xml documnet to Econnect. 
    }

Upvotes: 0

Views: 118

Answers (1)

Uranus
Uranus

Reputation: 1690

The very simple solution is to move the code setting the progress bar vaue to the BarFormobj_load event handler right after the code submitting the XML file.

Upvotes: 0

Related Questions