Hi,

How can I read out the content of a ListViewEx item?

Bálint Tóth

Re: OpenCFNET forms question by Balint

Balint
Wed Feb 25 10:50:17 CST 2004

I mean ListBoxEx, sorry.

"Balint Toth" <toth.b@alpha.tmit.bme.hu> az alábbiakat írta a következo
üzenetben news:uUOHyR7%23DHA.3256@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> How can I read out the content of a ListViewEx item?
>
> Bálint Tóth
>
>



Re: OpenCFNET forms question by Ginny

Ginny
Wed Feb 25 11:22:43 CST 2004

Bálint,

Do you mean something like
listBoxEx1.Items[listBoxEx1.SelectedIndex].ToString()

--
Ginny Caughey
.Net Compact Framework MVP

"Balint Toth" <toth.b@alpha.tmit.bme.hu> wrote in message
news:uPsry97%23DHA.2636@TK2MSFTNGP09.phx.gbl...
> I mean ListBoxEx, sorry.
>
> "Balint Toth" <toth.b@alpha.tmit.bme.hu> az alábbiakat írta a következo
> üzenetben news:uUOHyR7%23DHA.3256@TK2MSFTNGP09.phx.gbl...
> > Hi,
> >
> > How can I read out the content of a ListViewEx item?
> >
> > Bálint Tóth
> >
> >
>
>



Re: OpenCFNET forms question by Balint

Balint
Thu Feb 26 10:13:11 CST 2004

That's it! Thank you very much!

Best regards,
Bálint

"Ginny Caughey [MVP]" <ginny.caughey.online@wasteworks.com> az alábbiakat
írta a következo üzenetben news:%23MNJzP8%23DHA.2432@TK2MSFTNGP11.phx.gbl...
> Bálint,
>
> Do you mean something like
> listBoxEx1.Items[listBoxEx1.SelectedIndex].ToString()



Re: OpenCFNET forms question by Balint

Balint
Thu Feb 26 15:26:50 CST 2004

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



Re: OpenCFNET forms question by Maarten

Maarten
Thu Feb 26 16:05:36 CST 2004

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
>
>



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
> >
> >
>
>



Re: OpenCFNET forms question by Alex

Alex
Thu Feb 26 16:33:34 CST 2004

Exactly!

The foreground color of the control itself is just a guidance for the new
items.
I don't think it makes sense to change the color of all the existing items
when the forecolor of the control's changed. You might have the items of a
different color already added...

--
Alex Yakhnin .NET CF MVP
www.intelliprog.com | www.opennetcf.org

"Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
message news:ulQsDYL$DHA.2480@TK2MSFTNGP12.phx.gbl...
> 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
> > >
> > >
> >
> >
>
>



Re: OpenCFNET forms question by Balint

Balint
Thu Feb 26 18:09:26 CST 2004

OK, now I got it! Thank you very much!

Best regards,
Bálint Tóth

"Alex Yakhnin [MVP]" <a.yakhnin@online.att.net> az alábbiakat írta a
következo üzenetben news:eTwTTiL$DHA.1792@TK2MSFTNGP12.phx.gbl...
> Exactly!
>
> The foreground color of the control itself is just a guidance for the new
> items.
> I don't think it makes sense to change the color of all the existing items
> when the forecolor of the control's changed. You might have the items of a
> different color already added...
>
> --
> Alex Yakhnin .NET CF MVP
> www.intelliprog.com | www.opennetcf.org