Thread: C# Vending Machine Coding

  1. #1
    Registered User
    Join Date
    Jul 2014
    Posts
    2

    C# Vending Machine Coding

    Can someone help me out with this? imgur: the simple image sharer

    I kinda sucks in coding so please do help me out.

    Thank you in advance.

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    what part is giving you trouble? what have you tried so far?
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  3. #3
    Registered User
    Join Date
    Jul 2014
    Posts
    2
    the part where you press "A2" e.g. then the message box shows up the price. And then the change come up

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    That interface looks like old school Windows Forms. Intercept the button press, show a message box with the price and do math to get the change. In C# this amounts to a button press event handler, a call to System.Windows.Forms.MessageBox.Show() and some math.

    If it is WPF and you are using MVVM then ensure your view model is the DataContext of the control. Create a DelegateCommand class and bind the Command of the button to the DelegateCommand in your view model. Use System.Windows.MessageBox for message boxes in WPF and the rest is the same math as in the Forms application. If you are not using MVVM then bind to the button press event of the button and put the rest of the button handler logic in the code behind.

    If it is Silverlight then stop right now and move on because it has effectively been deprecated.
    Last edited by VirtualAce; 08-07-2014 at 01:32 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 03-22-2010, 04:54 PM
  2. Replies: 7
    Last Post: 11-22-2009, 04:11 AM
  3. Vending Machine Logic?
    By shwetha_siddu in forum C Programming
    Replies: 10
    Last Post: 04-07-2009, 03:33 AM
  4. Wanna test vending machine
    By Roaring_Tiger in forum Tech Board
    Replies: 6
    Last Post: 08-25-2004, 05:51 PM
  5. Vending machine
    By Unregistered in forum C++ Programming
    Replies: 6
    Last Post: 06-13-2002, 10:21 PM