Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# ListBox Component

Status
Not open for further replies.

TotalInsanity

Programmer
Oct 18, 2006
20
0
0
GB
Hello All.

Can one of you experts help me out here.

I have a list box in my development and I want to obtain the actual text that is stored at one of its indexes and place into a string.

Basically I am trying to colour each row dependant upon what text it contains by overriding the list boxes 'drawItem' function.

I have been trying to use:

Code:
string strPriority = listbox1.Items[e.Index].ToString();

which puts a string called: "SYSTEM.DATA>DATAROWVIEW" into the strPriority string declared above.

My listbox is being filled within the FormLoad event and is being filled by using a dataset.

Can anyone please point out where I am going wrong and whymy sting does not have the actual text from the list box??

Thanks in advance Gurus...
 
Sorry, please do not respond to this thread!

I was being an idiot, I have just parsed through the dataset again instead of the listbox component to get the data and set my listbox colours.

DOH!

Thanks anyway :O)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top