C#.Net Relational Operators - Windows Application
Code:
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 LearnWithThiru
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void label8_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == textBox2.Text)
{
label4.Text = "A==B";
}
else
{
label4.Text = "A Not = B";
}
}
private void button2_Click(object sender, EventArgs e)
{
if (textBox1.Text != textBox2.Text)
{
label5.Text = "A!=B";
}
else
{
label5.Text = "A==B";
}
}
private void button3_Click(object sender, EventArgs e)
{
int a = Convert.ToInt32(textBox1.Text);
int b = Convert.ToInt32(textBox2.Text);
if (a > b)
{
label6.Text = "Value A is Big";
}
else
{
label6.Text = "Value B is Big";
}
}
private void button4_Click(object sender, EventArgs e)
{
int x = Convert.ToInt32(textBox1.Text);
int y = Convert.ToInt32(textBox2.Text);
if (x < y)
{
label7.Text = "Value A is Small";
}
else
{
label7.Text = "Value B is Small";
}
}
private void button5_Click(object sender, EventArgs e)
{
int s=Convert.ToInt32(textBox1.Text);
int t = Convert.ToInt32(textBox2.Text);
if (s >= t)
{
label8.Text = "The Value A is Big or = B";
}
else
{
label8.Text = "Value B is big";
}
}
private void button6_Click(object sender, EventArgs e)
{
int z = Convert.ToInt32(textBox1.Text);
int f = Convert.ToInt32(textBox2.Text);
if (z <= f)
{
label9.Text = "The Value A is small or = B";
}
else
{
label9.Text = "Value B is small";
}
}
}
}
0 Comments