November 11th, 2013, 05:25 AM
Help with Classes in win forms
Hi Guys Im currently well into building a program that simulates a vending machine using win forms and Ive come a little stuck.
I currently have four classes
Vending machine UI (form1) updates the Form controls based on current state passed from vending processor
Vending Processor - heart and sole of the app
Product Holder - controls the product quatities etc
Coin Holder - controls the coin quatities etc
Heres my problem....
I have a label on my Vending machine UI (form1) called lblSelection and when the user clicks a selection button I want to simple update the label with the selection number. However, the button click event is currently in my product class and I cant access the lblSelection from the product class so I can update it.
Its probably simple and im having a brain freeze but im obviously missing something here.
Any help grately apprechiated