+ Reply to Thread
Results 1 to 8 of 8

possible to have multiple colors in multilne textbox in a form?

  1. #1
    Registered User
    Join Date
    04-07-2011
    Location
    Gent, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    38

    Question possible to have multiple colors in multilne textbox in a form?

    Hi guys,

    Is it possible to use multiple colors in a multiline textbox.

    It's because I have a userform with some buttons like for opening a txt/csv file.
    And in the form I have a multiline textbox that I use as kind of LOG window.
    So I use it like:

    Please Login or Register  to view this content.
    And I would like to paste the things that are correct in GREEN and things they go wrong in RED and maybe other things just in a default black.

    The only thing I find is forecolor but like in the example below the whole textbox changes color:

    Please Login or Register  to view this content.
    I suppose this doesn't work because forecolor changes the color for the whole textbox.

    Is there a way to achieve what I'm trying to do?

    Thanks in advance.

    Cheers

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: possible to have multiple colors in multilne textbox in a form?

    No I'm afraid there isn't way to do this with a standard textbox control.

    You could try a Rich TextBox control.

  3. #3
    Registered User
    Join Date
    04-07-2011
    Location
    Gent, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: possible to have multiple colors in multilne textbox in a form?

    Hi,

    Thanks for replying.
    I googled your suggestion about Rich TextBox cause I didn't know it existed. So apparently I have to add it in the workset.
    It's called Microsoft Rich Textbox Control, version 6.0 and it's pointed to c:\windows\system32\RichTx32.ocx (this is on my laptop with win7)

    I'm afraid that this Rich TextBox won't work if the person who is going to use the form doesn't have this ocx file right?
    There seem to be other problems with the Rich TextBox about security and that other ppl won't be able to execute the file.

    I'm so surprised that there isn't an (easy) way to make something like this and that would work to whoever you distribute your file/form.

    So if you or anyone else have a better suggestion to achieve using colors, please let me know.

    Cheers.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: possible to have multiple colors in multilne textbox in a form?

    What exactly is in the multiline textbox?

    You mention some sort of 'log'.

  5. #5
    Registered User
    Join Date
    04-07-2011
    Location
    Gent, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: possible to have multiple colors in multilne textbox in a form?

    Hi,

    Well I want to show information about what is happening.
    Like:

    Importing File OK
    Data to Array OK
    Array to Class OK


    or

    Select correct file. No file imported.
    Importing File OK

    And so on. These are just examples by the way.
    So this box is used to show what is happening and if they forgot something or did something wrong.
    It is not for letting the user type something into to the box.

    Thanks

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: possible to have multiple colors in multilne textbox in a form?

    Why not use a listbox for that?

    Or if you do want to format the text a ListView, which is another non-standard control but is more likely to be present than the Rich Textbox control.

  7. #7
    Registered User
    Join Date
    04-07-2011
    Location
    Gent, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: possible to have multiple colors in multilne textbox in a form?

    Hi,

    That's good advice. I don't mind if it's a listbox.
    I didn't think about that.

    I'll have to see what the difference is between a listbox and listview.

    Thanks again for keep helping through this!!!
    I really appreciate it.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: possible to have multiple colors in multilne textbox in a form?

    I suppose the important difference for what you want to do is that you can format the items in a ListView, which is something you can't do in a ListBox.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1