Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. // If you double click, it will select the sounds
  2. private void Form3UpgradesGunSounds_MouseDoubleClick(object sender, MouseEventArgs e)
  3. {
  4. if (e.X > 36 && e.X < 336 && e.Y > 35 && e.Y < 93) // FireTankCannon100
  5. {
  6. _tankCannon100 = true;
  7. }
  8. else if (e.X > 336 && e.X < 670 && e.Y > 35 && e.Y < 93) // FireTankCannon120
  9. {
  10. _tankCannon120 = true;
  11. }
  12. this.Close();
  13. }
  14. public bool GetTankCannon100()
  15. {
  16. return _tankCannon100;
  17. }
  18. public bool GetTankCannon120()
  19. {
  20. return _tankCannon120;
  21. }
  22.  
  23. public void MoleShooter_MouseClick(object sender, MouseEventArgs e)
  24. {
  25. // ...
  26. Form3UpgradesGunSounds fr3UpgradesSounds = new Form3UpgradesGunSounds();
  27. bool _f1tankCannon100 = fr3UpgradesSounds.GetTankCannon100();
  28. bool _f1tankCannon120 = fr3UpgradesSounds.GetTankCannon120();
  29.  
  30. if (_f1tankCannon100 == false)
  31. {
  32. F1TankCannon100();
  33. }
  34. else if (_f1tankCannon120 == true)
  35. {
  36. F1TankCannon120();
  37. }
  38. // ...
  39. }
  40.  
  41. public void F1TankCannon100() { /*. Do something .*/ }
  42.  
  43. public void F1TankCannon120() { /*. Do something .*/ }
  44.  
  45. public partial class Form2: Form
  46. {
  47. public static bool BolleanProperty { get; set; }
  48. // ...
  49. }
  50.  
  51. public partial class Form2 : Form
  52. {
  53. public static bool BolleanProperty { get; set; }
  54. static Form2()
  55. {
  56. BolleanProperty = true;
  57.  
  58. }
  59. public Form2()
  60. {
  61. InitializeComponent();
  62. }
  63. }
  64.  
  65. private void Form1_Load(object sender, EventArgs e)
  66. {
  67. label1.Text = Form2.BolleanProperty.ToString();
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement