How to mimic JavaScript's onBlur event in Windows Forms?

前端 未结 4 688
再見小時候
再見小時候 2021-01-18 00:06

I have phone and email textboxes on a Windows Form that I want to validate when the user leaves the fields.

When I double click the textbox in Visual Studio form des

4条回答
  •  盖世英雄少女心
    2021-01-18 00:47

    The Validating event was designed to do this. Set e.Cancel = true if you're not happy with the input. The ErrorProvider component is ideal to provide visual feedback.

提交回复
热议问题