Results 1 to 3 of 3

Thread: Locking a text box

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Location
    Glasgow, Scotland
    Posts
    71

    Locking a text box

    Hi,

    I like this new vb .net but something are really hard to figure out and they should not be.

    I need to make my text box readonly/locked without them going gray. I want to push figures into the text boxs from code but not let the user access the controls. How do I do this???

    Thanks for your help,

    Chris

  2. #2
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    I think you can override the KeyPress and/or KeyDown methods for the textbox and set e.Handled=True. Something like that?
    This world is not my home. I'm just passing through.

  3. #3
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Hi.

    You can still use the ReadOnly property.
    True, the textbox is greyed out when you set this property, but you can change the background and foreground colors afterwards.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

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