I am new to C# and would just like to ask a question.
I am working on a Windows application and am trying to insert a progress bar which does not work when I call it from another namespace.
My code:
namespace CLT
{
public partial class GenBulkReceipts : UserControl
{
public void ProressBarMovement()
{
progressBar1.PerformStep();
}
public void LoadProgressBar(int progressbarMax)
{
progressBar1.Minimum = 1;
progressBar1.Maximum = progressbarMax;
progressBar1.Value = 1;
progressBar1.Step = 1;
}
private void btnOpen_Click(object sender, EventArgs e)
{
try
{
OpenFile();
}
}
private void OpenFile()
{
if (dsEx1.Tables[0].Rows.Count > 0)
{
AccountsToBeImported = new BLLService().Get_AccountsToBeReceipted(dsEx1);
}
}
}
namespace BLL
{
class GenBulkReceiptsBLL
{
public DataSet Get_AccountsToBeReceipted(DataSet dsImport)
{
CLT.GenBulkReceipts pb = new CLT.GenBulkReceipts();
pb.LoadProgressBar(dsImport.Tables[0].Rows.Count);
foreach (DataRow dr in dsImport.Tables[0].Rows)
{
//Code cgoes here
}
pb.ProressBarMovement();
}
}
}
I would appreciate any help
Thanks a mil