ASSIGNMENT # 4
SUBMITTED TO:
SIR RAMEEZ IQBAL
SUBMITTED BY:
RABIA ZAFAR
17581556-045
SECTION ‘A’
VISUAL PROGRAMMING
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace assignment
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
}
private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = !char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar);
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox3.Text == "Programmer")
{
MessageBox.Show("allowed");
}
else
{
MessageBox.Show("Please Enter correct Occupation");
}
if (textBox1.Text == "")
{
textBox1.BackColor = Color.Red;
}
if (textBox2.Text == "")
{
textBox2.BackColor = Color.Red;
}
if (textBox3.Text == "")
{
textBox3.BackColor = Color.Red;
}
if (textBox4.Text == "")
{
textBox4.BackColor = Color.Red;
}
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
string str = "Name =" + textBox1.Text + Environment.NewLine + "Address ="
+ textBox2.Text + Environment.NewLine + "Occupation = " + textBox3.Text +
Environment.NewLine + "Age = " + textBox4.Text;
textBox5.Text = str;
}
}
}
Vp4
Vp4

Vp4

  • 1.
    ASSIGNMENT # 4 SUBMITTEDTO: SIR RAMEEZ IQBAL SUBMITTED BY: RABIA ZAFAR 17581556-045 SECTION ‘A’ VISUAL PROGRAMMING
  • 2.
    using System; using System.Collections.Generic; usingSystem.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace assignment { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button2_Click(object sender, EventArgs e) { this.Close(); } private void textBox4_TextChanged(object sender, EventArgs e) { } private void textBox4_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = !char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar); }
  • 3.
    private void textBox1_TextChanged(objectsender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { if (textBox3.Text == "Programmer") { MessageBox.Show("allowed"); } else { MessageBox.Show("Please Enter correct Occupation"); } if (textBox1.Text == "") { textBox1.BackColor = Color.Red; } if (textBox2.Text == "") { textBox2.BackColor = Color.Red; } if (textBox3.Text == "") { textBox3.BackColor = Color.Red; } if (textBox4.Text == "") { textBox4.BackColor = Color.Red; } } private void textBox3_TextChanged(object sender, EventArgs e) { } private void button3_Click(object sender, EventArgs e) { string str = "Name =" + textBox1.Text + Environment.NewLine + "Address =" + textBox2.Text + Environment.NewLine + "Occupation = " + textBox3.Text + Environment.NewLine + "Age = " + textBox4.Text; textBox5.Text = str; } } }