Re: OpenCFNET forms question by Paul
Paul
Thu Feb 26 16:15:18 CST 2004
Just tested this myself. It makes sense, if you think about it. When a new
item is added to the Items collection, its foreground color is set to the
listboxex's foreground color. If you want to change the foreground color of
an item that was previously added, you have to change it explicitly.
Paul T.
"Maarten Struys, eMVP" <maarten.struys@nospam.pts.nl> wrote in message
news:OeE6pQL$DHA.1464@tk2msftngp13.phx.gbl...
> If you want to change the foreground of the existing items, you can use
this
> code snippet:
>
> foreach (OpenNETCF.Windows.Forms.ListItem li in listBoxEx1.Items)
>
> {
>
> li.ForeColor = Color.Violet;
>
> }
>
>
> --
> Regards,
>
> Maarten Struys, eMVP
> PTS Software bv
>
> www.opennetcf.org | www.dotnetfordevices.com
>
> "Balint Toth" <toth.b@alpha.tmit.bme.hu> wrote in message
> news:e$KY68K$DHA.3536@tk2msftngp13.phx.gbl...
> > A new problem has raised:
> >
> > changing the foreground the foreground of the existing items do not
> change:
> >
> > myListBoxEx.ForeColor = Color.Violet;
> > myListBoxEx.RefreshItems();
> >
> > Doesn't work. Additionally if I add a new item, than it's color is
violet.
> >
> > Maybe this is a bug in OpenNETCF?
> >
> > Regards,
> > Bálint
> >
> >
>
>