Results 1 to 5 of 5

Thread: [2008] Disabled multi-line text box that's scrollable... possbile?

Threaded View

  1. #4
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [2008] Disabled multi-line text box that's scrollable... possbile?

    Quote 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:
    1. Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
    2.         e.SuppressKeyPress = True
    3. End Sub
    Last edited by chris128; Jan 16th, 2009 at 06:09 AM.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width