Click here to Skip to main content
15,892,965 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a project vending machine. C#/ WPF
But I can only click once on the button. It needs to be clicked on till the value is the same as the cost.
For example, if the drink costs 2€, I can only click once on the button 1€. The 2€ button is not a problem because this value is the same and proceeds to the next step.
An image of the project can be found at: http://img338.imageshack.us/img338/5613/softdrinkvend.jpg
Posted
Updated 6-Dec-09 10:02am
v3

1 solution

okay i got a bit futher

private void button1_Click(object sender, RoutedEventArgs e)

{

if (Convert.ToInt32(label1.Content) < Convert.ToInt32((button1.Content)))

{

// Do Somthing

}

else

{

//Disable the Button

button1.IsEnabled = false;

}



}
thnx to Kirtan
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900