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

  • Home
  • SEARCH
  • 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 8551711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:15:18+00:00 2026-06-11T14:15:18+00:00

If I have a project and I do not how design corresponds to the

  • 0

If I have a project and I do not how design corresponds to the code is there a way to make the debugger break every time I press any button so I can quickly navigate to the right place in the code or am I asking for too much here?

  • 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-06-11T14:15:19+00:00Added an answer on June 11, 2026 at 2:15 pm

    You can make a call to System.Diagnostics.Debugger.Break() to tell any attached debuggers to break at that line.

    If none are attached, Windows will try to launch any registered debuggers. If not are registered, you’ll get an exception/crash of the application. So, don’t leave it in the code in production 🙂

    e.g. (as per icemanind’s comment)

    #if DEBUG
        Debugger.Break();
    #endif 
    

    If you want to break on a click of any button, it gets a bit tricky. The easiest thing is to write a Button wrapper class and override OnClick and put your Break call in there. For example:

    public class ButtonWedge : Button
    {
        protected override void OnClick(System.EventArgs e)
        {
            Debugger.Break();
            base.OnClick(e);
        }
    }
    

    Once you add that class you can drag and drop it on the design surface. But, if you’ve already got code, you can edit the designer.cs file and replace System.Windows.Forms.Button with ButtonWedge.

    Once in OnClick, you can see where the Click event will go by looking at the base classes Events array with the Control.EventClick key. That will contain a multicast delegate that you can look at the Method and Target properties to find out what has subscribed to this Click event. In other words, the name of the click handler at runtime will be:

    string handlerName = base.Events[Control.EventClick].Target.GetType().FullName + '.'
       + base.Events[Control.EventClick].Method.Name;
    

    It doesn’t really put a break point in a particular Click event but lets you know what’s going on and where…

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

Sidebar

Related Questions

I am working in Fast Survey Project!! i have no time for design a
On an old project because of not thought through design I have a column
I have my project name, but not the numeric Project Id. The latter is
I have a project involving hand-written assembly—AT&T syntax, works fine with GCC, but not
What are useful strategies to adopt when you or the project does not have
I have a large project that executes without problem when not debugging (even when
I have a lein project (using cascalog--but that's not particularly important). I'm trying to
I have a small project that I was using node-dirty for, but it's not
I have a .war project in Eclipse. It is probably not relevant but I
Possible Duplicate: cmake is not working in opencv c++ project I have a huge

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.