need help about user control
need help about user control
Hi all,
I make a user control that need validation. So before one control is
validated another control cannot focus. but when iam trying to
check/uncheck checkbox and radiobutton, click button with different
usercontrol, these controls can be focused and executed. it makes me very
confuse. Need help from all of you guys, how to solve this problem.
I have uploaded my simple program at this link below
http://rapidshare.de/files/13003561/WindowsApplication2.rar.html
try to click control in yellow area, compare with control colour area.
Thanks in advance
Wirawan
|
|
|
need help about user control
bobherm
As far as i can see you just need to handle the CheckedChanged event.
private void chkMyCheckBox_CheckChanged( object sender, EventArgs e )
{
pnlConfig.Enabled = chkMyCheckBox.Checked;
}
Liviu Uba
CARR215
as you can see in my source code i add a validation in UserControl1.cs in
private void textBox1_Validating(object sender, System.ComponentModel.CancelEventArgs e)
{
if(textBox1.Text.IndexOf(".") >= 0)
{
e.Cancel = true;
}
}
so it will make me cannot enter or click to the other control. but strange behaviour occur when i try to click or enter control in another user control as you can see with userControl12 (the usercontrol with yellow colour), i still can click or enter on it and make the button, checkbox and radiobutton event executed even the textboxt in userControl11 still false because the text has '.' character.
need help for this such problem.
regards
wirawan