0% found this document useful (0 votes)
34 views4 pages

Assignment

code

Uploaded by

Ali Haider
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views4 pages

Assignment

code

Uploaded by

Ali Haider
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

susing 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 WindowsFormsApplication1

ii public partial class Form1 : Form


ii

ii {
ii

ii ii ii public Form1()
ii

ii ii ii {
ii

ii ii ii ii ii InitializeComponent();
ii

ii ii ii }
ii

ii ii

ii ii ii private void textBox1_KeyPress(object sender, KeyPressEventArgs e)


ii

ii ii ii {
ii

ii ii ii ii ii if(!char.IsControl(e.KeyChar) && !char.IsLetter(e.KeyChar) )


ii

ii ii ii ii ii {
ii

ii ii ii ii ii ii ii e.Handled = true;
ii

ii ii ii ii ii }
ii

ii ii ii }
ii

ii ii ii private void textBox3_KeyPress(object sender, KeyPressEventArgs e)


ii

ii ii ii {
ii

ii ii ii ii ii ii

ii ii ii ii ii if (!char.IsControl(e.KeyChar) && !char.IsLetter(e.KeyChar))


ii

ii ii ii ii ii {
ii
ii ii ii ii ii ii ii e.Handled = true;
ii

ii ii ii ii ii }
ii

ii ii ii }
ii

ii ii ii private void textBox4_KeyPress(object sender, KeyPressEventArgs e)


ii

ii ii ii {
ii

ii ii ii ii ii if (!char.IsControl(e.KeyChar) && !char.IsNumber(e.KeyChar))


ii

ii ii ii ii ii {
ii

ii ii ii ii ii ii ii e.Handled = true;
ii

ii ii ii ii ii }
ii

ii ii ii }
ii

ii ii ii private void EXIT_Click(object sender, EventArgs e)


ii

ii ii ii {
ii

ii ii ii ii ii Application.Exit();
ii

ii ii ii }
ii

ii ii ii private void OK_Click(object sender, EventArgs e)


ii

ii ii ii {
ii

ii ii ii ii ii iiif(textBox1.Text=="" || textBox2.Text=="" || textBox3.Text=="" ||

textBox4.Text=="")

ii ii ii ii ii {
ii

ii ii ii ii ii ii ii MessageBox.Show("Please enter in all textboxes");


ii

ii ii ii ii ii ii ii textBox1.Focus();
ii

ii ii ii ii ii }
ii

ii ii ii ii ii else
ii

ii ii ii ii ii {
ii

ii ii ii ii ii ii ii Output.Items.Clear();
ii

ii ii ii ii ii ii ii Output.Items.Add("Name:" +
ii textBox1.Text);
ii

ii ii ii ii ii ii ii textBox1.Clear();
ii

ii ii ii ii ii ii ii Output.Items.Add("Adress:" + textBox2.Text);
ii

ii ii ii ii ii ii ii textBox2.Clear();
ii

ii ii ii ii ii ii ii Output.Items.Add("Occupation:" + textBox3.Text);
ii
ii ii ii ii ii ii ii textBox3.Clear();
ii

ii ii ii ii ii ii ii Output.Items.Add("Age:" + textBox4.Text);
ii

ii ii ii ii ii ii ii textBox4.Clear();
ii

ii ii ii ii ii ii ii textBox1.Focus();
ii

ii ii ii ii ii }
ii

ii ii ii ii ii ii

ii ii ii ii ii ii

ii ii ii }
ii

ii ii ii private void textBox4_TextChanged(object sender, EventArgs e)


ii

ii ii ii {
ii

ii ii ii }
ii

ii }
ii

You might also like