CS0120: An object reference is required for the non-static field, method, or property 'Student_Form.StudentID_textBox'

BenTam 1,801 Reputation points
2022-09-06T04:14:46.693+00:00

Dear All,

I encounter an error "CS0120: An object reference is required for the non-static field, method, or property 'Student_Form.StudentID_textBox'".

238015-error.gif

I try to assign a value "0" to the textBox as shown in the screen capture below in the design time. I still get this error. Could anybody tell me how to fix it?

237985-textbox.gif

Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.