Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 zadanie1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- S.lCykli = 4;
- } Sprawdz S = new Sprawdz();
- public class Sprawdz:CheckBox
- {
- public int cykl=1;
- public int lCykli { get; set; }
- public Sprawdz() : base()
- {
- lCykli = 4;
- }
- public virtual void ileCykli()
- {
- if (cykl==lCykli)
- {
- MessageBox.Show("Kliknąłeś za dużo razy!");
- cykl = 1;
- }
- else
- cykl+=1;
- }
- }
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- if (checkBox1.Checked == true || checkBox1.Checked == false)
- {
- S.ileCykli();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement