Thursday 24 November 2016

C# program small application create in netbean
















 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 groupbox

        {

        publicpartialclassForm1:Form

        {

public Form1()

        {

        InitializeComponent();

        }


        privatevoid checkBox5_CheckedChanged(object sender,

        EventArgs e)

        {

        if(checkBox5.Checked)

        {

        groupBox1.Visible=true;

        button1.Visible=true;

        checkedListBox1.Visible=true;

        button2.Visible=true;

        }

        else

        {

        groupBox1.Visible=false;

        button1.Visible=false;

        checkedListBox1.Visible=false;

        button2.Visible=false;

        }

        }


        privatevoid button1_Click(object sender,EventArgs e)

        {

        String str="";

        if(checkBox1.Checked)

        {

        str+=checkBox1.Text+"\n";

        }

        if(checkBox2.Checked)

        {

        str+=checkBox2.Text+"\n";

        }

        if(checkBox3.Checked)

        {

        str+=checkBox3.Text+"\n";

        }

        if(checkBox4.Checked)

        {

        str+=checkBox4.Text+"\n";

        }

        MessageBox.Show(str);

        }


        privatevoid button2_Click(object sender,EventArgs e)

        {

        String str="";

        CheckedListBox.CheckedItemCollection con=checkedListBox1.CheckedItems;

        for(int i=0;i<con.Count;i++)

        {


        str+=con[i].ToString()+",";


        }

        if(str!="")

        {

        str=str.Substring(0,str.Length-1);

        MessageBox.Show(str);

        }

        }

        }

        }

No comments:

Post a Comment