private void tboxes_Validated(object sender, EventArgs e)
        {
            TextBox myTextBox = (TextBox)sender;
            int     t;

            if (!int.TryParse(myTextBox.Text, out t))
            {
                errorProvider.SetError(myTextBox, "Please enter a numeric value");
                myTextBox.Focus();

                //TODO: not allowed to start
                uiHelper.StartButton(false);
            }
            else
            {
                errorProvider.SetError(myTextBox, string.Empty);
                uiHelper.StartButton(true);
            }
        }
        public BankSimulator(UIHelper uiHelper, int numTellers, int numCustomers, decimal custGoalAmount, decimal initialBankVaultBalance, 
                                decimal maxTransactionAmount, decimal custInitialAmount)
        {
            uiHelper.StartButton(true);

            this.uiHelper = uiHelper;
            this.cancelTokenSource = new CancellationTokenSource();
            CancellationToken ct = cancelTokenSource.Token;
            int timeoutThrottle = 10;

            this.bank = new Bank(uiHelper, ct, numTellers, numCustomers, custInitialAmount, initialBankVaultBalance);

            // Cannot start the transaction Generator until the CustomerList is ready (ie not null)
            while (bank.Customers==null) {
                //Thread.Sleep(100);
            }

            this.transactionGenerator = new TransactionGenerator(uiHelper, ct, bank.BankQueue, bank.Customers, maxTransactionAmount, timeoutThrottle);
        }