Home > Net >  Newbie question: winform add any control in "the object reference not set to an instance of an
Newbie question: winform add any control in "the object reference not set to an instance of an

Time:10-28

Can compile and run the program, but to put any controls any form will pop up the error, ignore the word can also compile operation, new control don't show, but don't drag controls can add, drag to add an error...

CodePudding user response:

The object reference not set to an instance of an object is usually a class is empty in the wrong place probably add breakpoints, you step by step and then adjust to try?

CodePudding user response:

It means, there is a step, looking for your company manager, manager for various reasons, but your company does not exist, such as promotion when President, of departure, the company has just haven't recruitment to... So, want to let the "manager" do something out of the question.
How to deal with the problem? The newly appointed a manager, can be airborne, can promote etc...
Specific who find your manager, of course, that depends on the specific code zha write.
Of course this is only, for example, may not only short of the manager, your code also lack of front desk little younger sister, lack of personnel, lack of farmers, the application of each kind of design is good, good instantiation, well organized, debugging good, good. Just like the company to manage the listed a truth.

CodePudding user response:

The object reference not set to an instance of an object all these conditions are not instantiate new remember just graduation encountered this problem, the manager said anyone who encounters this kind of problem still not solve the ship out

CodePudding user response:

After the form drag controls, look at the form building function (winform) will automatically generate any code generated automatically instantiated,
  •  Tags:  
  • C #
  • Related