Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 23rd, 2006, 01:35 PM
Authorized User
Join Date: Jun 2003
Location: Rio de Janeiro, Rio de Janeiro, Brazil.
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default Change the ForeColor in a ListBox??


I have a code below to create a listbox.

foreach (DataRow OrderListaInstitu in thisDataSetLista.Tables ["institu"].Rows)
                ptlistainst.listBox1.Items.Add (OrderListaInstitu ["instituicao"]);

I would like to change the color of only one item.

If i use the code:

ptlistainst.ForeColor = Color.Red;

All of them change the color.

There is a way to change the ForeColor of only one item in a listbox??
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
i didn't find "forecolor" in font's properties! honey62 Visual Studio 2005 1 May 18th, 2008 03:46 AM
Change color of text in a listbox? ja8261 VB.NET 2002/2003 Basics 11 April 27th, 2007 10:14 AM
ForeColor doesn't display correctly. goldenstate ASP.NET 2.0 Basics 3 February 16th, 2007 12:36 PM
On change listbox johnjohn Classic ASP Basics 4 December 2nd, 2004 12:51 AM
can I change the forecolor and backcolor of text saffower VS.NET 2002/2003 4 October 11th, 2004 02:38 PM

All times are GMT -4. The time now is 08:23 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.