knowledge-database (beta)

Current group: comp.programming

VB6 listbox item colouring/highlighting

VB6 listbox item colouring/highlighting  
Edward
 Re: VB6 listbox item colouring/highlighting  
edwardmluk at hotmail.com
 Re: VB6 listbox item colouring/highlighting  
Programmer Dude
From:Edward
Subject:VB6 listbox item colouring/highlighting
Date:19 Jan 2005 04:29:00 -0800
Ok, my problem is a little complex, but hopefully someone can help me.
Image the setup, I have a listbox in a form with a list of products
with their relevant data in them in a view like below:

ITEM1 DATA1 DATA2
ITEM2 DATA1 DATA2

So each item has its data in columns. One of these is number in stock,
and I would like to make it so that any item below a set number for
number in stock has its font coloured red. Not sure how to define
between the different components for each product. All the products
are being read in from a random access file if that changes anything.
Is this at all explained properly, or do you want my current work sent
so you can all try for yourselves?

Any ideas would be greatly helpful.
Thanks.
Ed
From:edwardmluk at hotmail.com
Subject:Re: VB6 listbox item colouring/highlighting
Date:20 Jan 2005 04:55:18 -0800

Programmer Dude wrote:
> Edward writes:
>
> > Image the setup, I have a listbox in a form with a list of products
> > with their relevant data in them in a view like below:
> >
> > ITEM1 DATA1 DATA2
> > ITEM2 DATA1 DATA2
> >
> > So each item has its data in columns. One of these is number in
stock,
> > and I would like to make it so that any item below a set number for
> > number in stock has its font coloured red.
>
> If you're using a ListBox control, you can't color individual lines
> unless you're willing to take on "owner draw", and I'm not entirely
> sure you CAN do that from VB6.
>
> A ListView control, however, has an individual .ForeColor property
> for each ListItem (but be advised, it'll only color the text of the
> first column).
>
> > Not sure how to define between the different components for each
> > product.
>
> Not sure what you're asking here. If it's a matter of any stock
number
> below some value, just compare them to that value.
From:Programmer Dude
Subject:Re: VB6 listbox item colouring/highlighting
Date:Wed, 19 Jan 2005 11:03:04 -0600
Edward writes:

> Image the setup, I have a listbox in a form with a list of products
> with their relevant data in them in a view like below:
>
> ITEM1 DATA1 DATA2
> ITEM2 DATA1 DATA2
>
> So each item has its data in columns. One of these is number in stock,
> and I would like to make it so that any item below a set number for
> number in stock has its font coloured red.

If you're using a ListBox control, you can't color individual lines
unless you're willing to take on "owner draw", and I'm not entirely
sure you CAN do that from VB6.

A ListView control, however, has an individual .ForeColor property
for each ListItem (but be advised, it'll only color the text of the
first column).

> Not sure how to define between the different components for each
> product.

Not sure what you're asking here. If it's a matter of any stock number
below some value, just compare them to that value.
   

Copyright © 2006 knowledge-database   -   All rights reserved