Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. private void cmbX_Graphics_Width_LostFocus(object sender, EventArgs e)
  2. {
  3. int i = 0, width = 0;
  4.  
  5. TLQAShared._debug("Lost Focus Fired");
  6.  
  7. for (i = 0; i < cmbX_Graphics_Width.Items.Count; i++)
  8. {
  9. if (cmbX_Graphics_Width.Text.Equals(cmbX_Graphics_Width.Items[i].ToString()))
  10. {
  11. Properties.X.Default.Graphics_Width = int.Parse(cmbX_Graphics_Width.Items[i].ToString());
  12. TLQAShared._debug("FOUND!");
  13.  
  14. return;
  15. }
  16.  
  17. TLQAShared._debug("FOR: " + i.ToString() + "/" + (cmbX_Graphics_Width.Items.Count - 1).ToString() + ": " + cmbX_Graphics_Width.SelectedText + ":" + cmbX_Graphics_Width.Items[i].ToString());
  18. }
  19.  
  20. TLQAShared._debug("Not true: '" + cmbX_Graphics_Width.Text + "'");
  21.  
  22. if (int.TryParse(cmbX_Graphics_Width.Text.ToString(), out width))
  23. {
  24. TLQAShared._debug("TryParse: true");
  25.  
  26. Properties.X.Default.Graphics_Width = width;
  27. }
  28. else
  29. {
  30. tt.SetToolTip(cmbX_Graphics_Width, "You must supply a valid integer");
  31.  
  32. this.ActiveControl = cmbX_Graphics_Width;
  33. TLQAShared._debug("TryParse invalid.");
  34. }
  35. }
  36.  
  37. TLQAShared._debug("Not true: '" + cmbX_Graphics_Width.Text + "'");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement