Professional Documents
Culture Documents
Contents
Program 1.................................................................................... 2
Design....................................................................................... 2
Coding....................................................................................... 3
Implement................................................................................. 5
Program 2.................................................................................... 6
Design....................................................................................... 6
Coding....................................................................................... 7
Implement................................................................................. 8
Program 3.................................................................................... 9
Design....................................................................................... 9
Coding..................................................................................... 10
Implement...............................................................................12
Program 1
Design
Coding
Form1.cs
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
namespace Login
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label2_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "yussuf" && textBox2.Text == "1234")
{
Welcome obj = new Welcome();
obj.Show();
}
else
{
}
}
private void button2_Click(object sender, EventArgs e)
{
Close();
}
Welcome.cs
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
namespace Login
{
public partial class Welcome : Form
{
public Welcome()
{
InitializeComponent();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
Wrong.cs
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
namespace Login
{
public partial class Wrong : Form
{
public Wrong()
{
InitializeComponent();
}
}
}
Implement
Program 2
Design
Coding
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
namespace Shape
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void checkBox3_CheckedChanged(object sender, EventArgs e)
{
checkBox1.Checked = false;
checkBox2.Checked = false;
rectangleShape1.Visible = checkBox3.Checked;
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
checkBox2.Checked = false;
checkBox3.Checked = false;
ovalShape1.Visible = checkBox1.Checked;
}
private void checkBox2_CheckedChanged(object sender, EventArgs e)
{
checkBox1.Checked = false;
checkBox3.Checked = false;
ovalShape2.Visible = checkBox2.Checked;
}
}
Implement
Program 3
Design
Coding
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
namespace Student_Detail_Report
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
e)
d = a + b + c;
textBox7.Text = d.ToString();
f = (a + b + c)/3;
textBox8.Text = f.ToString();
if (f >= 85)
{
textBox9.Text = "A+";
}
else if (f >= 75 && f < 85)
{
textBox9.Text = "A";
}
else if (f >= 70 && f < 75)
textBox9.Text = "B+";
}
else if (f >= 65 && f < 70)
{
textBox9.Text = "B";
}
else if (f >= 60 && f < 65)
{
textBox9.Text = "C+";
}
else if (f >= 55 && f < 60)
{
textBox9.Text = "C";
}
else if (f >= 50 && f < 55)
{
textBox9.Text = "D+";
}
else if (f >= 40 && f < 50)
{
textBox9.Text = "D";
}
else
{
textBox9.Text = "Fail";
}
}
private void button2_Click(object sender, EventArgs e)
{
textBox9.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox5.Clear();
textBox6.Clear();
textBox7.Clear();
textBox8.Clear();
}
}
Implement