C# Tutorial - Spawn picture boxes in random position and click to remove in win forms app

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ก.ย. 2024

ความคิดเห็น • 27

  • @nourdoghmosch5535
    @nourdoghmosch5535 2 ปีที่แล้ว +2

    Thx so much you are awesome

  • @33v4.
    @33v4. 3 ปีที่แล้ว +3

    Thanks!

    • @mooict
      @mooict  3 ปีที่แล้ว

      You're Welcome!

  • @yazanjordan3103
    @yazanjordan3103 2 ปีที่แล้ว +2

    this is very nice i did it and i it work exactly like yours but i thought about something how to make it spawn different colors instade of red like 5 more colors in one code ?? i actually added one more color by just duplicate the code in makePicturebox func and changed the Vars and it worked but iam sure there is another easy way with one code i tried my hard to figure it out and i fail

    • @mooict
      @mooict  2 ปีที่แล้ว +1

      That's amazing Yazan. 👍

  • @kienhoanginh1281
    @kienhoanginh1281 ปีที่แล้ว +1

    thank u

    • @mooict
      @mooict  ปีที่แล้ว

      You're welcome!

  • @Dupe-s6i
    @Dupe-s6i ปีที่แล้ว

    Hi, just wondering what could be the issue if nothing happens when you click on the boxes?
    They are spawning just fine but they aren't disappearing when I click em.

    • @mooict
      @mooict  ปีที่แล้ว

      Check if the click event is linked to the form. That might be why the event is not triggering.

    • @Dupe-s6i
      @Dupe-s6i ปีที่แล้ว

      @@mooict will check that, thanks for answering!

  • @doke5300
    @doke5300 2 ปีที่แล้ว

    How would you make it so that you would have to click start button before the game starts

    • @yousif4200
      @yousif4200 2 ปีที่แล้ว

      First, you must add a Button from the form maker
      Then you need to go into your TImer1 Properties or in this case "GameTimer"
      and under behaviour
      Make Enabled into False
      Then Find the private void
      In this case it would be "Button1_Click" [assuming u didnt rename it]
      Under that all you need to write is
      GameTimer.Enabled = true;
      (This will tell the timer to start when you press the start button.)
      [When you open the form without pressing start, nothing will spawn]
      Im sure im late, but im glad i could help someone out

  • @nonsense3791
    @nonsense3791 2 ปีที่แล้ว

    Dude I have a pictureBox and at the clicked point I pull out a box but the box stays behind the pictureBox and does not appear. Should I set the z-index?

    • @nonsense3791
      @nonsense3791 2 ปีที่แล้ว

      solution = box.BringToFront();

    • @Zeki_Kaya
      @Zeki_Kaya 2 ปีที่แล้ว

      can you share your codes if you have codes 😊

  • @moloko_127
    @moloko_127 2 ปีที่แล้ว

    What if I want to count the pics I clicked instead of counting pics on screen

    • @mooict
      @mooict  2 ปีที่แล้ว

      After the remove action is called in the click event you can say score += 1; if you want to make a score integer first and then use that to monitor the successful clicks to the picture boxes.

  • @bluevidztv8844
    @bluevidztv8844 3 ปีที่แล้ว +1

    On my recommended

  • @yousif4200
    @yousif4200 2 ปีที่แล้ว

    How can one implement a way to remove the boxes after a certain amount of time
    BoxRemover.Interval = 250;
    ^ this line will define how much time passes before the boxes disappear,
    Then I want to implement a Life method.
    When the boxes disappear, -1 life gets taken.
    You have 3 lives
    Then I want to add that when the 3 lives turn to 0, The game end and MessageBox.Show( "Game Over", "Better Luck next time", MessageBoxButtons.Ok);
    With option of Ok

    • @mooict
      @mooict  2 ปีที่แล้ว

      This tutorial might help th-cam.com/video/BbWgUaS60yE/w-d-xo.html

  • @egemenaydinlioglu7231
    @egemenaydinlioglu7231 2 ปีที่แล้ว

    hi. I copied your codes but i can not even get any red images. i was trying to create buttons but even copy of your codes doesnt make any image box on my app.. why this could be ? codes are not giving eror and app starting

    • @mooict
      @mooict  2 ปีที่แล้ว

      Have you linked the event to the timer? Check the timer events window.

    • @egemenaydinlioglu7231
      @egemenaydinlioglu7231 2 ปีที่แล้ว

      @@mooict damn... i just missed it thank you so much.. But my homework is: There will be 10 random buttons and random numbers inside it. then you have to click ascending numbers like 5,24,56,60 etc. and when you clicked min number it must disappear.. So any recomend how to do it ? :D

  • @КатеринаГруша-я1ж
    @КатеринаГруша-я1ж ปีที่แล้ว

    how to make picture boxes spawn faster they spawn so slow

    • @mooict
      @mooict  ปีที่แล้ว

      Hi, to speed up the time change the timer interval in the properties window to 100. You can play around with this number and see what suits you.

  • @sicilianmrsavage6611
    @sicilianmrsavage6611 3 ปีที่แล้ว

    Racing game?

    • @mooict
      @mooict  3 ปีที่แล้ว

      There are two racing game style tutorials on the channel. One with Windows form and one with WPF hope that helps.