D
D
dmitry_dev332018-03-16 18:37:02
C++ / C#
dmitry_dev33, 2018-03-16 18:37:02

How to fix "object reference does not point to an instance of an object" error?

Windows Forms. Program "Calculator". When clicking on a TextBox or any empty area on the form (except buttons), debugging is interrupted by the message "Unhandled exception of type 'System.NullReferenceException'. Additional information: 'Object reference does not point to an instance of an object.' why the program reacts this way, especially it is not clear why this happens when you click on an empty (!) area of ​​the form where no components are placed.I wrote event handlers only for Buttons.
5aabe46301f6c809172108.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VoidVolker, 2018-03-16
@dmitry_dev33

This error means that instead of an object - null.

  1. Run the program in debug mode;
  2. Reproduce the error;
  3. Follow the link to the specified point in the source code;
  4. You fix the error.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question