Check/Option buttons Clearing

Check/Option buttons Clearing

Anonymous
Not applicable
558 Views
1 Reply
Message 1 of 2

Check/Option buttons Clearing

Anonymous
Not applicable

I am moving my application to C#.  When I click OK, my Check Box, Option Buttons, and Text box clear when the message box appears.

 

It goes through all my else if statements fine.  But when it reaches the statement for the sheet size, the objects in the date area clear.

 

 

else if(optRevHeader.Checked)
{
     // Check if user wants to use the paper size selected
     if(MessageBox.Show("Sheet size = " + cmbSheetSize.Text, "Sheet Size?", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
          // Add sheet size parameter to drawing properties if it does not exist
          if (strSheetSize == "") MySheetParameter.subAddCustomParam(MyStaticVars.GetSheetParameter(), cmbSheetSize.Text);
          else if (strSheetSize != cmbSheetSize.Text) MySheetParameter.subChangeCustomParam(MyStaticVars.GetSheetParameter(), cmbSheetSize.Text);

 

 

I'm not sure what's going on.

0 Likes
Accepted solutions (1)
559 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

Sorry, I found the answer.  The line before it had a single = symbol instead of a double == symbol.

 

 

else if(optCustomDateLong.Checked = true && chkCurrentDate.Checked == false && (DateTime.TryParseExact(mtbEcoDate.Text, "MM/dd/yyyy",
     System.Globalization.CultureInfo.CurrentCulture, System.Globalization.DateTimeStyles.None, out MyDate)) == false)

 

should be

 

else if(optCustomDateLong.Checked == true && chkCurrentDate.Checked == false && (DateTime.TryParseExact(mtbEcoDate.Text, "MM/dd/yyyy",
     System.Globalization.CultureInfo.CurrentCulture, System.Globalization.DateTimeStyles.None, out MyDate)) == false)

 

 

 

 

0 Likes