Hi there,
I have a windows form application ... i have bunch of checkboxes on it and when i click on a button it checks those checkboxes...
i wanna add this one thing...i want the checkboxes to get unchecked when i click on the button again..
how do i do that.. and may be when i check it the
first time it checks the checkboxes and make the button pop out and when i check on it again it unchecks the checkboxes and button then appreas to be normal
also, would it be possible for me to create a switch custom control that will behave as a button
i mean when i click one side of the switch it check the checkboxes and when i click the other it unchecks them
Please get back to me with whatever you can offer
Thanks alot
Loading
ShaniPosted Mar 18, 2009, 4:42 PM
how do i do this..
when i check the button(just a normal button on form) it checks the checkboxes and goes in
when i check it again it pops out and unchecks the checkboxes..
i have the code and everything for checkboxes but i just need to know how i can add this functionality
also, i wanted to thank you for the vidoes that you gave me couple of weeks ago for creating a dll class library, creating exe ..
Bechir BejaouiPosted Mar 18, 2009, 3:44 PM
you download two a switcher image with the two states opened and closed, then you rename them closed.bmp opened.bmp
private void Form1_Load(object sender, EventArgs e)
{
pictureBox1.Image = System.Drawing.Image.FromFile("closed.jpg");
}
private void pictureBox1_Click(object sender, EventArgs e)
{
if (checkBox1.Checked)
{
pictureBox1.Image = System.Drawing.Image.FromFile("opened.jpg");
checkBox1.Checked = false;
}
else
{
pictureBox1.Image = System.Drawing.Image.FromFile("closed.jpg");
checkBox1.Checked = true;
}
}
You can changes the states according to your needs