Ch-5 C#
Ch-5 C#
Ch-5 C#
In C#, a form is an object that represents a
graphical user interface (GUI) window or dialog
box. It contains controls such as buttons, text boxes,
and labels, and is used to interact with the user.
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
namespace TextBoxExample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
nameTextBox.Text = "";
telephoneTextBox.Text = "";
}
}
nameLabel.Text = name;
telephoneLabel.Text = telephone;
nameLabel.ForeColor = Color.Blue;
telephoneLabel.ForeColor = Color.Blue;
}
}
}
Q6. Build a stop watch using Windows Form.
using System;
using System.Windows.Forms;
using System.Diagnostics;
namespace StopWatchExample
{
public partial class Form1 : Form
{
private Stopwatch stopwatch = new
Stopwatch();
public Form1()
{
InitializeComponent();
}