using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace vendingmachineprogram
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
label2.Text = "Computer 0.50";
label2.Visible = true;
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void pictureBox3_Click(object sender, EventArgs e)
{
label4.Text = "Camera - 0.90";
label4.Visible = true;
}
private void pictureBox2_Click(object sender, EventArgs e)
{
label3.Text = "T.V - 0.70";
label3.Visible = true;
}
private void pictureBox5_Click(object sender, EventArgs e)
{
label5.Text = "Mobile Phone - 0.65";
label5.Visible = true;
}
private void pictureBox4_Click(object sender, EventArgs e)
{
label6.Text = "Internet - 1.00";
label6.Visible = true;
}
private void pictureBox6_Click(object sender, EventArgs e)
{
label7.Text = "Radio = 0.80";
label7.Visible = true;
}
private void groupBox1_Enter(object sender, EventArgs e)
{
{
button1.Enabled = true;
}
}
private void label1_Click(object sender, EventArgs e)
{
}
private void maskesTextBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if(!char.IsNumber(e.KeyChar))
{
e.Handled = true;
}
}
private void button1_Click(object sender, EventArgs e)
{
string input = this.textBox1.Text;
if (input.Equals("0.50")) MessageBox.Show("Computer\n In 1975 Ed Roberts coined the term personal computer when he introduced the Altair 8800 \n The computer relied on a series of switches for inputting data and output data by turning on and off a series of lights.");
else if (input.Equals("0.70")) MessageBox.Show("Television \n - Hd is coming");
else if (input.Equals("0.90")) MessageBox.Show("Video Camera - Amazing");
else if (input.Equals("0.65")) MessageBox.Show("Mobile Phone - They now come with applications");
else if (input.Equals("1.00")) MessageBox.Show("Internet - Tim Berners Lee");
else if (input.Equals("0.80")) MessageBox.Show("Radio - i work for galaxy");
}
private void textBox1_TextChanged_1(object sender, EventArgs e)
{
button1.Enabled = true;
}
private void label2_Click(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
i was wondering if anyone could help me with defining my own class just a simple one to get me going, in this code. thanks.

New Topic/Question
Reply




MultiQuote






|