I do this fairly often here is reference I use
using System.Threading;
public class Script
{
//Declare a Class Level Progress Bar
private System.Windows.Forms.ProgressBar pbProgress;
public void InitializeCustomCode()
{
//Set up the Progress Bar on The UI
SetUpPB();
}
public void DestroyCustomCode()
{
//Kill the Progress bar
pbProgress.Dispose();
pbProgress=null;
}
//Setup Progress Bar
private void SetUpPB()
{
//Instanciate
pbProgress = new System.Windows.Forms.ProgressBar();
//Draw a textbox where you'd like the PB to be and get
its Location from there then remove textbox
pbProgress.Location = new System.Drawing.Point(20, 51);
pbProgress.Name = "pbProgress";
//Draw a TextBox where you'd like the PB to be and get
its Size from there then remove textbox
pbProgress.Size = new System.Drawing.Size(962, 28);
//Get a Hold of the Parent Container where you'd like
the PB to be
Epicor.Mfg.UI.App.UD10Entry.DetailPanel pnl =
(Epicor.Mfg.UI.App.UD10Entry.DetailPanel)csm.GetNativeControlReference("d5488fbc-e47b-46b6-aa3e-9ab7d923315a");
//Add PB to the above container
pnl.Controls.Add(pbProgress);
}
public void threadedfunction()
{
//In your Threaded Function Initialize your Progress Bar
Max, Min and Current
UD10Form.Invoke((ThreadStart)delegate()
{
// CD 7/11/2012
// Changed rows to 5 for testing.
// TODO: Set rows=grdJobs.Rows.Count after testing is done.
rows=5;
pbProgress.Maximum=rows;
pbProgress.Minimum=0;
pbProgress.Value=0;
pbProgress.Step=1;
});
/*LOOP WHICH REQUIRES PROGRESS NOTIFICATION*/
/*....... LOOP CODE HERE .....*/
//Step our progress bar to show progress before we loop again
UD10Form.Invoke((ThreadStart)delegate()
{
pbProgress.PerformStep();
});
/*END LOOP*/
}
}
*Jose C Gomez*
*Software Engineer*
*
*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
<http://www.usdoingstuff.com>
*Quis custodiet ipsos custodes?*
using System.Threading;
public class Script
{
//Declare a Class Level Progress Bar
private System.Windows.Forms.ProgressBar pbProgress;
public void InitializeCustomCode()
{
//Set up the Progress Bar on The UI
SetUpPB();
}
public void DestroyCustomCode()
{
//Kill the Progress bar
pbProgress.Dispose();
pbProgress=null;
}
//Setup Progress Bar
private void SetUpPB()
{
//Instanciate
pbProgress = new System.Windows.Forms.ProgressBar();
//Draw a textbox where you'd like the PB to be and get
its Location from there then remove textbox
pbProgress.Location = new System.Drawing.Point(20, 51);
pbProgress.Name = "pbProgress";
//Draw a TextBox where you'd like the PB to be and get
its Size from there then remove textbox
pbProgress.Size = new System.Drawing.Size(962, 28);
//Get a Hold of the Parent Container where you'd like
the PB to be
Epicor.Mfg.UI.App.UD10Entry.DetailPanel pnl =
(Epicor.Mfg.UI.App.UD10Entry.DetailPanel)csm.GetNativeControlReference("d5488fbc-e47b-46b6-aa3e-9ab7d923315a");
//Add PB to the above container
pnl.Controls.Add(pbProgress);
}
public void threadedfunction()
{
//In your Threaded Function Initialize your Progress Bar
Max, Min and Current
UD10Form.Invoke((ThreadStart)delegate()
{
// CD 7/11/2012
// Changed rows to 5 for testing.
// TODO: Set rows=grdJobs.Rows.Count after testing is done.
rows=5;
pbProgress.Maximum=rows;
pbProgress.Minimum=0;
pbProgress.Value=0;
pbProgress.Step=1;
});
/*LOOP WHICH REQUIRES PROGRESS NOTIFICATION*/
/*....... LOOP CODE HERE .....*/
//Step our progress bar to show progress before we loop again
UD10Form.Invoke((ThreadStart)delegate()
{
pbProgress.PerformStep();
});
/*END LOOP*/
}
}
*Jose C Gomez*
*Software Engineer*
*
*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
<http://www.usdoingstuff.com>
*Quis custodiet ipsos custodes?*
On Fri, Aug 10, 2012 at 12:04 PM, Brian Roberts <broberts@...> wrote:
> **
>
>
> Adding a status bar message & hourglass is easy (C# Epicor 9.05):
>
> using (oTrans.PushDisposableStatusText("Doing stuff...", true)) { your
> lengthy code... }
>
> For a fancier progress bar, remember you've got the entire .Net
> libraries available. You'll want the ProgressBar class, and you can add
> it manually as a control on the Epicor form (easier than creating a
> whole new form). Use the Epicor customization tools to position a
> hidden text box where you want it, and copy the location/size/etc when
> creating your ProgressBar.
>
> Brian.
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> Of Joe Rojas
> Sent: Friday, August 10, 2012 9:06 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] E9: Creating a modal popup window
>
>
> Hello,
>
> I have a custom process that runs when a user clicks a button in one of
> my dashboards.
>
> Depending on the number of rows selected, this process could take a bit
> to complete.
>
> I'd like to have a pop window with a progress bar that gives the user
> some indication that the process is running and that the dashboard isn't
> just locked up.
>
> In Visual Studio, this would be easy enough to create this popup window
> but in Epicor, there are no tools to visually build this.
>
> Has anyone coded a custom windows in Epicor? If yes how do you do it?
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>
>
[Non-text portions of this message have been removed]