Results 1 to 15 of 15

Thread: [RESOLVED] Text colours in combobox

  1. #1

    Thread Starter
    Lively Member Steve Cain's Avatar
    Join Date
    Sep 2000
    Location
    Wiltshire, UK
    Posts
    105

    Resolved [RESOLVED] Text colours in combobox

    Is there any way of setting (at design time) different colours for individual items in a combobox? I want to have certain items permenantly shown in a different colour to emphasise key options. A bold option would be OK also.

    e.g.

    Item 1
    Item 2
    Item 3
    Item 4
    Item 5
    Item 6

    or

    Item 1
    Item 2
    Item 3
    Item 4
    Item 5
    Item 6



    Thanks,

    Steve
    Old divers never die, they just go down on old wrecks

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Text colours in combobox

    Not with the standard VB combo box. You would need to find a third party combo control for this.

  3. #3

    Thread Starter
    Lively Member Steve Cain's Avatar
    Join Date
    Sep 2000
    Location
    Wiltshire, UK
    Posts
    105

    Re: Text colours in combobox

    I guessed as much

    Thanks for your very quick reply

    Steve
    Last edited by Steve Cain; Sep 23rd, 2008 at 11:39 AM.
    Old divers never die, they just go down on old wrecks

  4. #4
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Text colours in combobox

    You can use ImageCombo

    Squares on the left implicate the color
    Attached Images Attached Images  

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Text colours in combobox

    No, I'm afraid not.

  6. #6

    Thread Starter
    Lively Member Steve Cain's Avatar
    Join Date
    Sep 2000
    Location
    Wiltshire, UK
    Posts
    105

    Re: Text colours in combobox

    Cheers guys, thanks for your help.

    Steve
    Old divers never die, they just go down on old wrecks

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Text colours in combobox

    I found this. See the "CustomDraw LV Demo.zip" Does it help?

  8. #8

    Thread Starter
    Lively Member Steve Cain's Avatar
    Join Date
    Sep 2000
    Location
    Wiltshire, UK
    Posts
    105

    Re: Text colours in combobox

    Quote Originally Posted by Hack
    I found this. See the "CustomDraw LV Demo.zip" Does it help?
    This is certainly what I was after. The only downside is that it requires a DLL installing on the users machine, whereas I would prefer to create a stand alone program that doesn't need to be installed.

    This is of interest though and I will have a play, I am sure this can be of good use.

    Thanks

    Steve
    Old divers never die, they just go down on old wrecks

  9. #9
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Text colours in combobox

    If you want a program that doesn't need installation, don't use VB - even the most basic VB program requires certain files to be installed (which might be installed on your target computers already, but might not!).

    For more info, see the article Why doesn't my program work on another computer? from our Classic VB FAQs (in the FAQ forum, which is shown near the top of our home page)

  10. #10

    Thread Starter
    Lively Member Steve Cain's Avatar
    Join Date
    Sep 2000
    Location
    Wiltshire, UK
    Posts
    105

    Re: Text colours in combobox

    I create small utility programs, some are very basic. None require any installation and VB suits me fine.

    See some examples here: Diving utilities

    Steve
    Old divers never die, they just go down on old wrecks

  11. #11
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Text colours in combobox

    As explained in my previous post and the link I provided, all VB programs require some level of installation, as they all have dependencies - you have just been lucky (so far) that somebody else has already installed the components that are needed by your programs.

    That will not always be the case.

  12. #12
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Text colours in combobox

    Quote Originally Posted by si_the_geek
    That will not always be the case.
    And a point in case will be whatever control you decide to go with in terms of the combo box control that supports multi colored lines. That will require a formal installation and registration on each machine running the program.

  13. #13

    Thread Starter
    Lively Member Steve Cain's Avatar
    Join Date
    Sep 2000
    Location
    Wiltshire, UK
    Posts
    105

    Re: Text colours in combobox

    The programs I have written will all work with standard Windows installations, probably would work with basic Win98 install.

    Cheers all.

    Steve
    Old divers never die, they just go down on old wrecks

  14. #14
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Text colours in combobox

    That may be the case for certain editions of Win98SE but not the standard Win98, as it was released before VB6, and so does not include even the basic runtime package (even some editions of Win2000 don't).

    Even when the runtime package is installed, it could well be an old version (only Vista includes an up to date one!), and thus include many bugs - there have been hundreds of issues corrected over the years.

    Whether you are willing to admit it or not, so far you have just been lucky that somehow a version of the runtime has been installed before your program has been run (either as part of the Windows installation, or by a more knowledgeable programmer), and it does not have obvious bugs for your program.


    There are good reasons for the vast majority of programs for Windows requiring an installation - it isn't just done for show.

  15. #15
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Text colours in combobox

    I agree with si here. VB still needs some libraries to run no mather what components app uses. A great examples is the main VB library (if you're using VB6):
    Code:
    ...\SYSTEM32\msvbvm60.dll
    . If you delete it no VB app will work. As said, you're lucky all users had it on their Windows.

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