C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » Windows »

Use checkbox in windows form


Posted Date: 30 Oct 2009      Posted By: zulkifli      Member Level: Bronze     Points: 1   Responses: 4



hi, can anyone show me how to use checkbox in windows forms?

i have:-

one combobox and one textbox and a checkbox.

when i click on checkbox i want the combobox to be unenable and textbox will be enable





Responses

Author: Velkumar    30 Oct 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

Hi, First set the property of comboBox and textBox Enabled is to false

and the write the code given below

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked)
{
comboBox1.Enabled = false;
textBox1.Enabled = true;
}
else
{
comboBox1.Enabled = true;
textBox1.Enabled = false;
}
}



Author: Neetu    30 Oct 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Check the code.

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked)
{

textBox1.Enabled = true;
comboBox1.Enabled = false;
}
else
{
textBox1.Enabled = true;
comboBox1.Enabled = true;
}

}


regards
Neetu



Author: Deepika Haridas    30 Oct 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hello,


if(checkbox.checked)
{
combobox.enabled = false;
textbox.enabled = true;
}




Thanks & Regards,
Deepika
Editor

If U want to shine like a SUN..First U have to burn like the SUN!!
Need a Guide? Join my mentor program..



Author: zulkifli    30 Oct 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

wow....
thank guys....

i have tried all of the coding and its works...

really appreciate...



Post Reply
You must Sign In to post a response.
Next : Display header/logo in Rdlc report
Previous : How to open and view an excel page
Return to Discussion Forum
Post New Message
Category: Windows

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use