I'm getting confused and just want to be sure I'm understanding this correctly.
[Forgot to say, this is Visual C# .NET.]
A form is an instance of a forms class, right? Or is it an object of the class, and you could have multiple instances of the same form?
Same questions for a control. Say you have a text box on a form. That's an instance of the TextBox object... or class?
Okay, next you have a method on a form that accepts a parameter from the text box control and returns a different value to the same text box. (Example: It changes the case of the text from lower to upper case.) Since the method is on the form rather than within the text box's class (object?) code, it needs to be a public method... right? And is some kind of public method needed within the text box's code to allow the form's method to place the returned value in it?
Now, I would think a better way to do this is just to put the case-changing method right inside the text box code and make it private, BUT that's not what the exercise wants. So real-world, wouldn't that be the more efficient way to do it?
Last question: Would it be better to just use a public static void method and not return a value, since you could have a statement change the value and use a parameter (variable?) to get the new value?
You can see I'm getting confused. Please help.
[Forgot to say, this is Visual C# .NET.]
A form is an instance of a forms class, right? Or is it an object of the class, and you could have multiple instances of the same form?
Same questions for a control. Say you have a text box on a form. That's an instance of the TextBox object... or class?
Okay, next you have a method on a form that accepts a parameter from the text box control and returns a different value to the same text box. (Example: It changes the case of the text from lower to upper case.) Since the method is on the form rather than within the text box's class (object?) code, it needs to be a public method... right? And is some kind of public method needed within the text box's code to allow the form's method to place the returned value in it?
Now, I would think a better way to do this is just to put the case-changing method right inside the text box code and make it private, BUT that's not what the exercise wants. So real-world, wouldn't that be the more efficient way to do it?
Last question: Would it be better to just use a public static void method and not return a value, since you could have a statement change the value and use a parameter (variable?) to get the new value?
You can see I'm getting confused. Please help.