-1

I am making a student module application, within this, I am required to edit values with a list box. I need to use backing variables and get methods.

I have not covered this material in class and would be thankful for some advice!

The program is required to access the list value within the file, edit the mark and update the list.

Vikrant
  • 4,920
  • 17
  • 48
  • 72
JackC
  • 13
  • 5
  • You should try and add code examples of where you need to implement this etc. – TheChubbyPanda Apr 02 '19 at 21:40
  • Hi Chubby i apologise for the bland explanation, i do not fully understand the task in hand myself as i have not yet covered it. My program displays a list of module marks, the user is required to edit the mark and update the list. I have to do this within a class. I was advised to store the users input with a backing variable and use a get method. public string _result { get { return _result; } } – JackC Apr 02 '19 at 21:48
  • Much better, stick that in the question and you're on the way to becoming a pro stackoverflower XD – TheChubbyPanda Apr 02 '19 at 21:57
  • Sorry for the confusion i have caused, thanks anyway! – JackC Apr 02 '19 at 22:01
  • No problems caused – TheChubbyPanda Apr 02 '19 at 22:02

1 Answers1

0

This question shows how backing variables are used in getters and setters

Once you have the user's input stored in a variable such as string input for example, you can create a

public string userInput { get; set; }

Similar to the question mentioned above. You then use userInput.set(input) to set the variable to the users input.

TheChubbyPanda
  • 1,721
  • 2
  • 16
  • 37
  • how do i get the value from the list and update it? i would be telling fibs if i said i wasn't confused lol! – JackC Apr 02 '19 at 22:07
  • i think i need to process the users input in the edit form and sent it to the add form, could be wrong? does that make sense? – JackC Apr 02 '19 at 22:14