我的代码如下 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
发布评论