如何在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. 如何在C#windows窗體中驗證xml針對XSD
- 3. Xamarin窗體 - Windows驗證webapi
- 4. Windows窗體中的文本框驗證
- 5. Windows窗體中的文本驗證
- 6. Dotnet:如何在窗體窗體應用程序中實現Windows身份驗證?
- 7. 如何驗證Windows窗體中電話號碼的文本框?
- 8. Windows窗體 - 驗證DataGridView的輸入
- 9. 如何驗證TextBox值是C#Windows窗體應用程序中的字符串
- 10. 窗體驗證?
- 11. django中的窗體驗證
- 12. 如何驗證rails窗體如果將多窗體中的窗體拆分?
- 13. SignalR - 驗證Windows窗體服務器上的窗體用戶
- 14. 窗體驗證器對於Windows Phone
- 15. ASP.NET窗體身份驗證與Windows Safari
- 16. Windows窗體文本框驗證
- 17. windows窗體驗證問題(.net2.0)
- 18. MVC - 窗體和Windows身份驗證
- 19. 如何驗證Spring窗體:窗體的形式:使用JQuery驗證的密碼?
- 20. 在Windows窗體C#
- 21. 如何驗證wicket窗體的順序
- 22. 在Windows窗體應用程序中處理EF的驗證
- 23. 如何從asp.net窗體身份驗證轉換爲Windows身份驗證
- 24. 從窗體身份驗證轉換爲Windows身份驗證
- 25. 網站窗體身份驗證 - > SQL Server Windows身份驗證
- 26. Windows窗體C#
- 27. c#windows窗體
- 28. 在窗體中的JavaScript表單驗證?
- 29. 在窗體中字段的Javascript驗證
- 30. WPF窗體驗證
你能更具體? – 2009-12-23 04:56:26
請發佈你有什麼代碼,以及你想要做什麼。你的表單代碼將是一個很好的起點。 – 2009-12-23 05:34:01