troubleshooting Question

Progress Box

Avatar of RockBaby
RockBabyFlag for Singapore asked on
Programming Languages-OtherC#
7 Comments1 Solution504 ViewsLast Modified:
Hi,
I need to creating something like a progress box. From my app, when i click save in the SDialog, how can i do something like once i click OK, there will be a Progress Box appear but at the backend, it's saving my document.


SaveFileDialog SDialog = new SaveFileDialog();
SDialog.Filter = "Text Files(*.csv)|*.csv";

if (SDialog.ShowDialog() == DialogResult.OK)
{
   frmExecutingRpt frm=new frmExecutingRpt(this);
   frm.ShowDialog();
   //The progress Box will be appear here but the following code still running..

   using (StreamWriter FWriter = new StreamWriter(SDialog.FileName))
   {
      FWriter.WriteLine(DateTime.Now + "\n");
      FWriter.WriteLine(",,,,Events Report\n");
      FWriter.WriteLine("Alarm Time, Alarm, License No, TID, Latitude, Longitude, POLCOM(Ack),"
      +"COSCOM(Ack), POCC(Ack)");

         foreach (DataRow datarow2 in streamTable.Rows)
         {
            FWriter.WriteLine(datarow2["license_n"]);

               foreach (DataRow datarow in streamTable.Rows)
      {
            FWriter.WriteLine(datarow["alarmtime_dt"] + "," + datarow["des_x"] + "," + datarow
                           "license_n"] + "," + datarow["transid_c"] + ","  + datarow["lat_n"] + "," + datarow["lon_n"]
                          + "," + datarow["pcgack_i"] + ","  + datarow["rsnack_i"] + "," + datarow["pocc1ack_i"]);
      }
            }
FWriter.Close();
frm.Close();
//The progress box will be close here...
           Invoke( new ReportGenerationCompleteDelegate( OnReportCompleted ) );
    }
}
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros