当文本框验证失败时,更改文本框forecolor

编程入门 行业动态 更新时间:2024-10-25 02:24:07
本文介绍了当文本框验证失败时,更改文本框forecolor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的代码如下 studentid 10(textbox1)添加(按钮) 列表框 当用户输入studentid 10并单击添加按钮10时,studentid将显示在列表框中。 然后再次输入相同的学生ID 10,然后点击添加按钮,在标签中显示消息。 studentid 10已经存在。 i想要在用户输入相同的学生ID时显示不同颜色的studentid 10并单击添加按钮。 我可以用不同颜色显示学生ID 10. 我怎样才能在asp中使用c#。

My code as follows studentid 10(textbox1) Add(Button) Listbox When user type the studentid 10 and click the add button 10 studentid will be displayed in the listbox. Then again type the same student id 10 and click the add button shows the message in label. The studentid 10 is already exists. i want to show the studentid 10 in different colors when user type the same student id and click the add button. for that how can i display the student id 10 in different color. for that how can i do in asp using c#.

推荐答案

您可以生成一个随机数,您可以将其用作颜色代码。因此,可以在显示错误时更改颜色。 you can generate a random number and you can use that as the color code. So, the color can be changed on showing the error.

更多推荐

当文本框验证失败时,更改文本框forecolor

本文发布于:2023-11-03 16:05:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555524.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本框   forecolor

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!