Click here to Skip to main content
15,920,602 members
Home / Discussions / C#
   

C#

 
AnswerRe: About AutoResetEvent, a simple question Pin
Luc Pattyn8-Nov-10 1:42
sitebuilderLuc Pattyn8-Nov-10 1:42 
GeneralRe: About AutoResetEvent, a simple question Pin
RaviRanjanKr8-Nov-10 1:58
professionalRaviRanjanKr8-Nov-10 1:58 
GeneralRe: About AutoResetEvent, a simple question Pin
John Kenedy S.Kom8-Nov-10 16:11
John Kenedy S.Kom8-Nov-10 16:11 
QuestionDataGridView Pin
yesu prakash8-Nov-10 0:31
yesu prakash8-Nov-10 0:31 
AnswerRe: DataGridView Pin
Mycroft Holmes8-Nov-10 11:14
professionalMycroft Holmes8-Nov-10 11:14 
Questionretrieving listview values Pin
annie_bel8-Nov-10 0:13
annie_bel8-Nov-10 0:13 
AnswerRe: retrieving listview values Pin
phil.o8-Nov-10 0:19
professionalphil.o8-Nov-10 0:19 
GeneralRe: retrieving listview values Pin
annie_bel8-Nov-10 0:40
annie_bel8-Nov-10 0:40 
AnswerRe: retrieving listview values Pin
Luc Pattyn8-Nov-10 1:23
sitebuilderLuc Pattyn8-Nov-10 1:23 
AnswerRe: retrieving listview values Pin
RaviRanjanKr8-Nov-10 1:29
professionalRaviRanjanKr8-Nov-10 1:29 
GeneralRe: retrieving listview values Pin
annie_bel8-Nov-10 1:50
annie_bel8-Nov-10 1:50 
AnswerRe: retrieving listview values Pin
saransaki088-Nov-10 21:25
saransaki088-Nov-10 21:25 
GeneralRe: retrieving listview values Pin
RaviRanjanKr9-Nov-10 1:12
professionalRaviRanjanKr9-Nov-10 1:12 
Questionmulti level nested grid for win & web apps? Pin
Tridip Bhattacharjee7-Nov-10 22:14
professionalTridip Bhattacharjee7-Nov-10 22:14 
AnswerRe: multi level nested grid for win & web apps? Pin
Anurag Gandhi7-Nov-10 23:37
professionalAnurag Gandhi7-Nov-10 23:37 
AnswerRe: multi level nested grid for win & web apps? Pin
Eddy Vluggen8-Nov-10 1:06
professionalEddy Vluggen8-Nov-10 1:06 
AnswerRe: multi level nested grid for win & web apps? Pin
TweakBird9-Nov-10 0:30
TweakBird9-Nov-10 0:30 
AnswerRe: multi level nested grid for win & web apps? Pin
vamyip9-Nov-10 18:53
vamyip9-Nov-10 18:53 
QuestionArray Help [modified] Pin
pancakeleh7-Nov-10 20:33
pancakeleh7-Nov-10 20:33 
AnswerRe: Array Help Pin
Nuri Ismail7-Nov-10 21:23
Nuri Ismail7-Nov-10 21:23 
AnswerRe: Array Help Pin
Luc Pattyn8-Nov-10 1:30
sitebuilderLuc Pattyn8-Nov-10 1:30 
when you have an array (or any other collection) of colors, you can manipulate them directly. There is no need to first display them (i.e. their string representation) in a ListBox and then parse those strings, that approach is so wrong.

Here is an example of what one can do, without ListBox, without parsing text:
// creating an array of colors
Color[] colors=new Color[3];
colors[0]=Color.Yellow;
colors[1]=Color.Red;
colors[2]=myImage.GetPixel(0,0);


or

// creating a collection of colors
List<Color> colors=new List<Color>();
colors.Add(Color.Yellow);
colors.Add(Color.Red);
colors.Add(myImage.GetPixel(0,0));
...


then

// calculating average value of red component
int sumRed=0;
int count=0;
foreach (Color color in colors) {
      sumRed+=color.R;
      count++;
}
int averageRed=sumRed/count;


see? no ListBox, no strings, no problems. Also less code, and much faster.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Array Help Pin
pancakeleh8-Nov-10 14:21
pancakeleh8-Nov-10 14:21 
GeneralRe: Array Help Pin
Luc Pattyn8-Nov-10 14:31
sitebuilderLuc Pattyn8-Nov-10 14:31 
GeneralRe: Array Help Pin
pancakeleh8-Nov-10 14:43
pancakeleh8-Nov-10 14:43 
AnswerRe: Array Help Pin
David Ewen8-Nov-10 15:19
professionalDavid Ewen8-Nov-10 15:19 

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.