L
Lau Lei Cheong
Hello,
I'm writing a usercontrol that contains a property named "disabled". It
is set to false by default but there is also another button in the
usercontrol that'll set it to true.
On the main form a number of them are displayed. During the On_Load
event, 1) It'll check to see if the usercontrol is disabled. If true, the
row containing the usercontrol is hidden.
2) If all these usercontrols are disabled, the main form will redirect the
user to another form.
Here is my problem: Although I've successfully implemented (1) by
directly invoke "parent.visible = false" in the disablebutton_click event, I
couldn't find way to do checking (2) that won't let the usercontrol directly
call methods in the main form.
If I do the checking (2) in Form_load() of the main form, the form won't
redirect until a second refresh so a blank page will be displayed. Seems
that I have to put the code in other event but I have no idea. Can anyone
suggest what I should do to fix it?
Any help would be appreciated.
Regards,
Lau Lei Cheong
I'm writing a usercontrol that contains a property named "disabled". It
is set to false by default but there is also another button in the
usercontrol that'll set it to true.
On the main form a number of them are displayed. During the On_Load
event, 1) It'll check to see if the usercontrol is disabled. If true, the
row containing the usercontrol is hidden.
2) If all these usercontrols are disabled, the main form will redirect the
user to another form.
Here is my problem: Although I've successfully implemented (1) by
directly invoke "parent.visible = false" in the disablebutton_click event, I
couldn't find way to do checking (2) that won't let the usercontrol directly
call methods in the main form.
If I do the checking (2) in Form_load() of the main form, the form won't
redirect until a second refresh so a blank page will be displayed. Seems
that I have to put the code in other event but I have no idea. Can anyone
suggest what I should do to fix it?
Any help would be appreciated.
Regards,
Lau Lei Cheong