Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 23rd, 2006, 01:35 PM
Authorized User
 
Join Date: Jun 2003
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default Change the ForeColor in a ListBox??

Hi;

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





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





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