Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6537649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:38:31+00:00 2026-05-25T10:38:31+00:00

It sounds stupid, but this happens to me. I activate a function, and it

  • 0

It sounds stupid, but this happens to me.

I activate a function, and it does its work, and after it finishes it enables itself again. With other words, the function activates twice, not once. I tried to find out why by debugging, but I didn’t find the reason.

When I click on a panel this function activates:

private void Play(object sender, EventArgs e)
{
    Play0(MousePositionX, MousePositionY);
    if (swich_player == true && AI_enabled == true)
    {
        AI_playing();
        swich_player = false;
    }
}

The whole code is really long.

Is it me not searching correctly? Are there other reasons? In order for this function to start again, something has to activate it. I can’t find what is activating the function again.

Any suggestions, where to search for the problem? Or what is the problem?

EDIT:

I finally found the problem. There is a button (button1) that changes the panel’s properties, and a second button (button2) that makes the panel 0 pixels wide and 0 pixels high (in order to make it invisible). The first button also adds an EventHandler that activates the function. But button2 does not remove the EventHandler. This way the function gets called as much times as the times I have pressed button1.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:38:31+00:00Added an answer on May 25, 2026 at 10:38 am

    Looks like what you’re looking for (via your comments/edit) is the source of multiple calls to this function. With the current snippet of code, it’s not possible for us to tell. But what you should do is put a breakpoint on the entry of the function and then when it is hit, look at the “Call Stack” window in visual studio.

    This can be accessed via the Debug -> Windows -> Call Stack menu item (when running the program. It will not show up in Windows if you’re not running)

    You can then see what is calling your function through this window. It is an extremely useful tool.

    Pre Edit:
    Your question isn’t very clear, but I think (from your variable names) that you’re looking for a game loop that will continually run. If so, take a look at this blog post which has some very good information on different styles of game loops. It ranges from simple to more complex (and scalable) loops.

    Your question states that you activate something once and it “enables again”, and also that “In order this function to start again, something has to activate it. I can’t find what”. These seem to be contradictory statements. Can you edit your question to be a little clearer? If my answer is not what you were looking for after your edit, I will do my best to add whatever is needful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This sounds like a stupid question but, after uploading a file the file isnt
This probably sounds really stupid but I have noo idea how to implement jquery's
This sounds really stupid, but I was told that you could drag-and-drop visual components
Sorry if this sounds like a really stupid question, but I need to make
Cocoa newbie here... I know this sounds stupid but I can't find the Bindings
I know this sounds like a stupid question, but I really don't see the
This probably sounds like a stupid question, but I'm going to give it a
Well, I'm working on a small project, and this may sounds stupid, but I
This sounds like a stupid question while I'm asking it, but I'm new to
I know it sounds stupid but: I've found this application written on Mono and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.