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 CH1_EX5
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnEmpty_Click(object sender, EventArgs e)
        {
            txtName.Text = "";
            txtFamily.Text = "";
            txtTel.Text = "";
            txtEmail.Text = "";
            txtDescription.Text = "";
            txtName.Focus();
        }

        private void btnEnseraf_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnSend_Click(object sender, EventArgs e)
        {
            if (txtName.Text.Trim() == "" || txtFamily.Text.Trim() == "" || txtTel.Text.Trim() == "" || txtDescription.Text.Trim() == "")
            {
                MessageBox.Show("لطفا تمامی اطلاعات فرم را وارد کنید", "هشدار", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            MessageBox.Show("ارسال پیام با موفقیت انجام شد", "ارسال", MessageBoxButtons.OK, MessageBoxIcon.Information);
            txtName.Text = "";
            txtFamily.Text = "";
            txtTel.Text = "";
            txtEmail.Text = "";
            txtDescription.Text = "";
            txtName.Focus();
        }
    }
}
