Practical -2
Practical -2
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
// OR
//firsttxt.Clear();
//secondtxt.Clear();
//resulttxt.Clear();
}
} } }
------------------------------------------------------------------------------------------------------------------------------------------
When we want to display the new Form from existing Form write the following code under click envent.
Message Box
Write the following code under button click event. This code will reveals different aspects of Message
Box.
//second step
// MessageBox.Show("this is seventh semester","Semester",
MessageBoxButtons.YesNo);
// third step
if (MessageBox.Show("information", "semester",
MessageBoxButtons.OKCancel, MessageBoxIcon.Information) ==
DialogResult.OK)
{
// Application.Exit();
this.Close();
}
if (Convert.ToBoolean(DialogResult.No ))
{
MessageBox.Show("please, try again");
}
---------------------------------------------------------------------------------------------------------------------