C# WinForms ErrorProvider Control

后端 未结 5 1170
暗喜
暗喜 2020-11-27 20:56

Does anyone know if there is a way to get a list of controls that have the ErrorProvider icon active. ie. any controls that failed validation. I\'m trying to avoid looping

5条回答
  •  误落风尘
    2020-11-27 21:44

    You have to use SetError to set the error on the control in the first place, right? Perhaps you should store that information in another collection at the same time if you want to have it handy. For example, you could add each control with an error to a hashset.

提交回复
热议问题