
Originally Posted by
ryytikki
you could just make a small function that works on a timer ticking (set the tick timer to, say, 10) and then use this
Code:
textbox1.clear()
textbox1.text = "put your original text here)
This will reset the text whenever the timer ticks
Hope it helps
Ryy
Thats a really bad way of doing it in my opinion. For one thing having a timer running every 10 ms has got to have some kind of impact on performance and for another thing it is just plain bad design. You would probably also find that the text appears to be constantly flickering if its getting cleared and reset every 10 miliseconds.
The way I would do it would be to just set the forecolor and backcolor manually and leave the ReadOnly property as False, then just use the KeyDown event like this to stop users being able to type into it:
vb.net Code:
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
e.SuppressKeyPress = True
End Sub