Yea, that's how I understand it -- modal dialog. The funky thing is that
the exact code below used to work (i.e. the dialog box would display
modally) but now doesn't, so I gotta figure that there's some setting in
the emulator/PPC that is causing the "problem". Below is the entire
function--note that the MessageBox.Show() is at the end of the routine and
trust me when I step through the code it shows the message box and keeps
right on stepping through, closing the box at the end of the routine. I
tried this in debug mode on the actual PPC device.
private void txtTicketNo_TextChanged(object sender, EventArgs e)
{
bool errorOccurred = false;
if (txtTicketNo.Text.Length > 0)
{
//verify that only numbers can be entered
char[] digit = txtTicketNo.Text.ToCharArray();
string numberList = "1234567890";
string tmpTicketNo = "";
int pos = 0;
for (int i = 0; i <= digit.GetUpperBound(0); i++)
{
pos = numberList.IndexOf(digit
);
if (pos > -1)
{
tmpTicketNo += digit;
}
}
txtTicketNo.Text = tmpTicketNo;
}
//test whether we're at 18 characters yet
if (txtTicketNo.Text.Length == 18)
{
showConnecting();
if (!dTito.payTicket(currentCashierUserID,
currentCashierPassword, txtTicketNo.Text.ToString()))
{
txtTicketNo.Text = "";
txtTicketNo.Focus();
showLoggedIn();
errorOccurred = true;
}
else
{
addTicketToGrid(txtTicketNo.Text, dTito.TicketValue);
txtTicketNo.Text = "";
totalval += Convert.ToDouble(dTito.TicketValue);
//lastTotalVal += totalval;
string displayValue = String.Format("{0:c}", totalval);
txtTotal.Text = displayValue;
dTito.TicketValue = 0; //clear's Tito's ticket
value.
txtTicketNo.Focus();
}
showLoggedIn();
if (errorOccurred)
{
MessageBox.Show("Unable to verify ticket. Please take
ticket to Casino Cage for redemption. Thanks!", "Pay Ticket",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1);
}
}
}//end of tctTicketNo_TextChanged()
Thanks for having a look!
Don
MuZZy said:
Well, MessageBox.Show() is showing a modal dialog, execution process
waits for it to return a value of type DialogResult, so there is no way
your function would exit until you close the box.
Can you post a piece of your code here?
MuZZy