Guest User

Untitled

a guest
Nov 23rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.07 KB | None | 0 0
  1.         private void boxCheckar(object sender, EventArgs e)
  2.         {
  3.            
  4.             CheckBox box = (CheckBox)sender;
  5.             int boxID = Convert.ToInt16(box.AccessibleName);
  6.             if (box.Checked)
  7.             {   // Yes I know I could have used radio buttons for this but I didn't want to
  8.                 if (box == AggressiveStance)
  9.                 {
  10.                     DefendOnlyCheck.Checked = false;
  11.                     whatToWrite[boxID] = whatToWrite[boxID].Replace("false", "true");
  12.                 }
  13.                 if (box == DefendOnlyCheck)
  14.                 {
  15.                     AggressiveStance.Checked = false;
  16.                     whatToWrite[boxID] = whatToWrite[boxID].Replace("false", "true");
  17.                 }
  18.                 whatToWrite[boxID] = whatToWrite[boxID].Replace("false", "true");
  19.             }
  20.             else
  21.             {
  22.                 whatToWrite[boxID] = whatToWrite[boxID].Replace("true", "false");
  23.             }
  24.             // for testing purposes
  25.             InfoText.Text = whatToWrite[boxID];
  26.         }
Add Comment
Please, Sign In to add comment