-
April 26th, 2016, 02:53 PM
#1
Checkbox click function
I have C# form where is public function called 'FormUserEnrol_CheckClick' this function called when checkBox1 or checkBox2 click will open form FormFingerEnrol which working fine, but when I add another checkbox4 or checkbox5 or more nothing happend.
Please help: bellow code:
Code:
public void FormUserEnrol_CheckClick(object sender, EventArgs e)
{
CheckBox ckb;
ckb = sender as CheckBox;
FormFingerEnrol ffe = new FormFingerEnrol();
if(ffe.ShowDialog()==DialogResult.OK)
{
ckb.Checked = true;
if (ckb == checkBox1)
{
refsize1 = ffe.refsize;
ffe.refbuf.CopyTo(refbuf1, 0);
fingerbmp1 = ffe.fingerbmp;
pbImage1.Image = ffe.fingerbmp;
}
else if (ckb == checkBox2)
{
refsize2 = ffe.refsize;
ffe.refbuf.CopyTo(refbuf2, 0);
fingerbmp2 = ffe.fingerbmp;
pbImage2.Image = ffe.fingerbmp;
}
}
else
{
ckb.Checked = false;
if (ckb == checkBox1)
{
refsize1 = 0;
fingerbmp1 = null;
pbImage1.Image = null;
}
else if (ckb == checkBox2)
{
refsize2 = 0;
fingerbmp2 = null;
pbImage2.Image = null;
}
}
}
Last edited by Arjay; April 27th, 2016 at 11:24 AM.
Reason: Added code tags
-
April 27th, 2016, 11:27 AM
#2
Re: Checkbox click function
Originally Posted by kafsar
but when I add another checkbox4 or checkbox5 or more nothing happend.
In the code you have usage to checkBox1 and checkBox2, but no usages to checkBox4 and checkBox5. If you want it to work with those, you need to add code to use them.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|