This program is a simple Windows Form Application for counting the number of clicks done don on that form and as the user clicks the number counter will increase its value by 1.
Code for the program is as follows:-
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 clickcount
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int clickcount = 0;
private void button1_Click(object sender, EventArgs e)
{
clickcount++;
label1.Text = "number of clicks: " + clickcount + ".";
}
}
}
Code for the program is as follows:-
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 clickcount
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int clickcount = 0;
private void button1_Click(object sender, EventArgs e)
{
clickcount++;
label1.Text = "number of clicks: " + clickcount + ".";
}
}
}
No comments:
Post a Comment