My Google service terms and conditions



Code:

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

        private void Button1_Click(object sender, EventArgs e)
        {
            if(button1.Text == "Finish")
            {
                Application.Exit();
            }
            else
            {
                MessageBox.Show("This was the demo of this tutorial. Well done!");
                richTextBox1.Text = "Everything is cleared now.";
                button1.Text = "Finish";
            }
           
        }

     
     

        private void CheckBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked)
            {
                button1.Enabled = true;

              DialogResult result = MessageBox.Show("Do you want to copy the terms and agreement to the clipboard?", "Bishal says", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    Clipboard.SetText(richTextBox1.Text);
                    MessageBox.Show("Copied to clipboard!");
                }
                else
                {
                    MessageBox.Show("Process cancelled by the user.", "User cancellation", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                button1.Enabled = false;
            }
        }

     

        private void Button1_MouseHover(object sender, EventArgs e)
        {
            if (!checkBox1.Checked)
            {
                MessageBox.Show("You haven't accepted the terms and conditions yet.");
                checkBox1.Focus();
            }
        }
    }
}

Comments

Popular posts from this blog

&& and || in C# application