Results 1 to 4 of 4

Thread: [2005] text boxes forecolor

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Location
    Jacksonville, Florida
    Posts
    147

    Question [2005] text boxes forecolor

    I'm displaying data to a user on a form with a few data grid views. 2 of the 8 or so fields outside the datagridview I would like them to be able to be able to use their mouse to highlight that text and copy it. Moving from a label to a text box seems to accomplish that.

    I allow them to set their UI preferences including regular label colors, form colors, and problematically for the above data label colors.

    Text boxes don't appear to accept just changing the forecolor to change the color of the text.

    as I understand it, the best way to accomplish this is a rich text box, the other thing I thought was to allow them to just double click the data as a label and have my program then copy it to their clipboard, but this wouldn't give the user any obvious visual indication of the double click, and I'd have to manually tell people about it or send out an email to let them know the about the change.

    Currently the 2 text box fields are showing without being in the user selected colors, but at least they can mouse-highlight and copy just fine.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2005] text boxes forecolor

    is the textbox readonly?

    try this

    vb Code:
    1. textbox1.forecolor = color.red
    2. textbox1.backcolor = textbox1.backcolor

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2008
    Location
    Jacksonville, Florida
    Posts
    147

    Thumbs up Re: [2005] text boxes forecolor

    I don't have any idea how or why, and it's not working the way I'd like yet, but it certainly appears to be working, and yes they are read-only.

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2005] text boxes forecolor

    don't ask me why it happens either.
    i've had this problem before and setting the backcolor after the forecolor seems to work

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