Click here to Skip to main content
15,905,683 members
Home / Discussions / C#
   

C#

 
AnswerRe: const vs readonly Pin
MIHAI_MTZ25-Aug-06 0:01
MIHAI_MTZ25-Aug-06 0:01 
AnswerRe: const vs readonly Pin
coolestCoder25-Aug-06 0:03
coolestCoder25-Aug-06 0:03 
GeneralRe: const vs readonly Pin
Divyang Mithaiwala25-Aug-06 0:45
Divyang Mithaiwala25-Aug-06 0:45 
GeneralRe: const vs readonly Pin
coolestCoder25-Aug-06 0:53
coolestCoder25-Aug-06 0:53 
AnswerRe: const vs readonly Pin
Not Active25-Aug-06 2:36
mentorNot Active25-Aug-06 2:36 
AnswerRe: const vs readonly Pin
Scott Dorman1-Sep-06 13:50
professionalScott Dorman1-Sep-06 13:50 
Question64 bit application Pin
psamy24-Aug-06 23:48
psamy24-Aug-06 23:48 
AnswerRe: 64 bit application Pin
Not Active25-Aug-06 2:31
mentorNot Active25-Aug-06 2:31 
GeneralRe: 64 bit application Pin
Dave Kreskowiak29-Aug-06 2:08
mveDave Kreskowiak29-Aug-06 2:08 
QuestionThread with ListView Pin
mm31024-Aug-06 23:30
mm31024-Aug-06 23:30 
AnswerRe: Thread with ListView [modified] Pin
coolestCoder24-Aug-06 23:45
coolestCoder24-Aug-06 23:45 
GeneralRe: Thread with ListView Pin
mm31025-Aug-06 0:21
mm31025-Aug-06 0:21 
GeneralRe: Thread with ListView Pin
coolestCoder25-Aug-06 0:43
coolestCoder25-Aug-06 0:43 
Questionhow to get single item in foreach loop ?? Pin
sikandarhayat24-Aug-06 21:35
sikandarhayat24-Aug-06 21:35 
AnswerRe: how to get single item in foreach loop ?? Pin
Martin#24-Aug-06 21:41
Martin#24-Aug-06 21:41 
GeneralRe: how to get single item in foreach loop ?? Pin
sikandarhayat24-Aug-06 21:54
sikandarhayat24-Aug-06 21:54 
AnswerRe: how to get single item in foreach loop ?? [modified] Pin
Martin#24-Aug-06 22:16
Martin#24-Aug-06 22:16 
GeneralRe: how to get single item in foreach loop ?? Pin
sikandarhayat25-Aug-06 0:04
sikandarhayat25-Aug-06 0:04 
AnswerRe: how to get single item in foreach loop ?? Pin
Guffa25-Aug-06 0:08
Guffa25-Aug-06 0:08 
AnswerRe: how to get single item in foreach loop ?? Pin
Coding C#25-Aug-06 3:15
Coding C#25-Aug-06 3:15 
AnswerRe: how to get single item in foreach loop ?? Pin
Ennis Ray Lynch, Jr.25-Aug-06 3:22
Ennis Ray Lynch, Jr.25-Aug-06 3:22 
AnswerRe: how to get single item in foreach loop ?? Pin
Scott Dorman1-Sep-06 14:08
professionalScott Dorman1-Sep-06 14:08 
Since you mentioned that clsLabelCollection inherits from CollectionBase, it should have a Contains and an IndexOf method.

Assuming that both of these are actually implemented in the collection class, you can use them to find a specific clsLabels instance:

clsLabels l = null;
if (m_clsLabelCollection.Contains("value"))
{
int i = m_clsLabelCollection.IndexOf("value");
l = m_clsLabelCollection[i];
}

You can also iterate over the collection (using foreach) and explicitly test to see if the current item is equal to the one you want. When you find the match, break out of the loop.

This would be something like this:

clsLabels l = null;
foreach(clsLabels lbl in m_clsLabelCollection)
{
if (lbl.label == "value")
{
l = lbl;
break;
}
}

I'm assuming that lbl.label is a string field and that you are looking for the label "value".
QuestionGraphicsState and hardware Pin
s o v a n n24-Aug-06 21:25
s o v a n n24-Aug-06 21:25 
AnswerRe: GraphicsState and hardware Pin
leppie25-Aug-06 0:30
leppie25-Aug-06 0:30 
QuestionListBox With Tree Pin
Aslam Bari24-Aug-06 21:05
Aslam Bari24-Aug-06 21:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.