如何用C#编写代码以找出文本框中输入的文本是错误的. [英] How to write the code in C# to find out the entered text in the textbox is wrong.

查看:85
本文介绍了如何用C#编写代码以找出文本框中输入的文本是错误的.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在文本框中输入了一些单词,如果输入的单词是错误的,则必须立即用红色下划线指示用户输入的单词是错误的,并且当用户单击鼠标右键时,系统会自动建议一些正确的单词请为此提供代码.

在此先谢谢您.

When i entered some words in the text box if the entered word is wrong then immidiatly it has to indicate the user that entered word is wrong with red underline and when user click the mouse right button then system automatically suggest some correct words can you please provide the code for this its very urjent.

Thanks in advance.

推荐答案

文本框无法显示红色下划线,您也不能轻松地使其成为红色下划线.其余的事情都是微不足道的,一点也不紧急,我们很乐意为您提供帮助,但是由于您无法完成自己的工作,我们不会感到任何强迫.您可以使用字符串类的Contains方法查看字符串是否包含单词.您可以使用Split方法将字符串转换为单词集合.如果您想成为一名程序员,那么您当然需要学习进行基础研究,使用Google以及阅读和理解文档.当您要求我们执行基本任务并且不发布任何代码时,我们必须假设您甚至没有打扰尝试,也不会打扰.
A textbox cannot do the red underline, nor can you easily make it do that. The rest of this is trivial, and it''s not urgent at all, we are happy to help, but we don''t feel any compulsion based on your inability to do your own work. You can use the Contains method of the string class to see if a string contains a word. You can use the Split method to turn a string into a collection of words. You certainly need to learn to do basic research, use google, and read and understand documentation, if you want to be a programmer. When you ask us to do a basic task and post no code, we have to assume you''ve not even bothered trying, and can''t be bothered.


使用,而不是普通" TextBox,它允许进行某些格式化.我不确定红色底线是什么,但是至少您可以将特定单词的文本颜色更改为红色.
Use a RichTextBox instead of a "normal" TextBox, that allows for some formatting. I am not sure with the red underlining, but at least you could change the text color of a specific word to red.


这篇关于如何用C#编写代码以找出文本框中输入的文本是错误的.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆