在ASP.NET文本框中进行文本闪烁 [英] Making Text Blink in a ASP.NET Textbox

查看:90
本文介绍了在ASP.NET文本框中进行文本闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过使用以下代码来使文本框"控件中的文本闪烁,但它不起作用:

I am attempting to get text in my Textbox control to blink by using the following code, but it''s not working:

protected void btnBlink_Click(object sender, EventArgs e)
        {
            string holdText = "Hello Neo. Welcome to the Matrix.";
            txtBlinkText.Text = " ";

            //number of times to blink
            for (int times = 0; times < 500; times++)
            {
                Thread.Sleep(5000);
                txtBlinkText.Text = holdText;
                Thread.Sleep(2000);
                txtBlinkText.Text = " ";
      
            }
        }



我可以用另一双眼睛来帮助.当前结果是存在延迟,然后文本消失.我以为它可能会闪烁得如此之快,以至于我看不到它,但是我已经尝试过改变所有相同的结果的延迟间隔.我也尝试过通过Google搜索解决方案,但发现的结果无济于事.



I could use another pair of eyes to help. The current result is that there is a delay and then the text disappears. i thought it might be that it''s blinking so rapidly that I don''t see it, but I''ve tried varying the delay intervals all with the same result. I''ve also tried searching for solutions through Google, but the results I found did not help.

推荐答案

使用javascript进行此类操作.在您提出问题之后,我在这里创建了该文件.
使用Javascript闪烁TextBox中的文本 [
Use javascript for that kind of things. Here I just created that after your question.
Blinking Text in TextBox using Javascript[^]


这篇关于在ASP.NET文本框中进行文本闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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