如何在C#中驗證我的Windows窗體?如何在C中驗證我的Windows窗體#
-2
A
回答
-1
如果您正在尋找簡單的文本值或方框內打勾,如在服務方面的登錄表單或接受,你可以使用類似:
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "check text" &&
textBox2.Text == "check another field" &&
checkBox1.Checked)
{
//perform actions
}
else
{
MessageBox.Show("Your input failed validation.");
}
}
哪裏Button1的是提交按鈕,而textBox1,textBox2和checkBox1是正在驗證的各種字段。
+0
您正在繞過對控件使用「OnValidating」和「OnValidated」事件。 – IAbstract 2010-11-18 15:45:35
3
相關問題
- 1. 在Windows窗體驗證
- 2. Xamarin窗體 - Windows驗證webapi
- 3. Windows窗體中的文本框驗證
- 4. Dotnet:如何在窗體窗體應用程序中實現Windows身份驗證?
- 5. 如何驗證Windows窗體中電話號碼的文本框?
- 6. Windows窗體 - 驗證DataGridView的輸入
- 7. 如何驗證rails窗體如果將多窗體中的窗體拆分?
- 8. windows窗體驗證問題(.net2.0)
- 9. Windows窗體文本框驗證
- 10. 窗體驗證器對於Windows Phone
- 11. ASP.NET窗體身份驗證與Windows Safari
- 12. 如何從asp.net窗體身份驗證轉換爲Windows身份驗證
- 13. 從窗體身份驗證轉換爲Windows身份驗證
- 14. 網站窗體身份驗證 - > SQL Server Windows身份驗證
- 15. c#windows窗體
- 16. Windows窗體C#
- 17. 在窗體中的JavaScript表單驗證?
- 18. Rails窗體驗證
- 19. Silverlight(如)在Windows窗體應用程序驗證
- 20. 如何在Windows窗體應用程序中實現控件驗證?
- 21. 窗體上的驗證
- 22. 驗證Zend_Captcha_Image在窗體中使用時
- 23. 在c + +和Windows窗體中的陣列
- 24. 如何在Rails窗體中顯示file_field的驗證消息?
- 25. C++ windows窗體中的字體渲染
- 26. Windows窗體按鈕在C#
- 27. 使用Windows窗體中的dropdownlist驗證errorProvider?
- 28. 如何在Windows窗體
- 29. 如何在ASP.NET Web窗體中實際使用JQuery驗證遠程驗證
- 30. Windows窗體combobox.SelectedItem,C#
你能更具體? – 2009-12-23 04:56:26
請發佈你有什麼代碼,以及你想要做什麼。你的表單代碼將是一個很好的起點。 – 2009-12-23 05:34:01