Disable parent window controls when there is an error in userControl
-
26-04-2021 - |
Pregunta
In a Windows form I've some controls and a UserControl. I've a ErrorProvider in the UserControl. I want to stop editing all the controls in the Form if there is an error in the userControl. Is there any way to do that?
I am using errorProvider.BindToCustomDataAndErrors(..)
Solución
There is no any built-in way in Windows Forms
that I'm aware of, to do something like that. I do believe you should implement it by yourself.
You can create an event like ErrorRecieved
(say), and Disable controls in its handler.
EDIT
Here also a link to similar SO question.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow