Click here to Skip to main content
15,896,359 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: Array Help Pin
pancakeleh8-Nov-10 15:25
pancakeleh8-Nov-10 15:25 
GeneralRe: Array Help Pin
David Ewen8-Nov-10 15:37
professionalDavid Ewen8-Nov-10 15:37 
GeneralRe: Array Help Pin
pancakeleh8-Nov-10 15:39
pancakeleh8-Nov-10 15:39 
GeneralRe: Array Help Pin
pancakeleh8-Nov-10 15:47
pancakeleh8-Nov-10 15:47 
GeneralRe: Array Help Pin
David Ewen8-Nov-10 15:52
professionalDavid Ewen8-Nov-10 15:52 
GeneralRe: Array Help Pin
pancakeleh8-Nov-10 15:56
pancakeleh8-Nov-10 15:56 
QuestionWPF datagrid popup dropdown from from a combobox Pin
dhaessel7-Nov-10 18:15
dhaessel7-Nov-10 18:15 
AnswerRe: WPF datagrid popup dropdown from from a combobox Pin
dhaessel7-Nov-10 18:32
dhaessel7-Nov-10 18:32 
GeneralRe: WPF datagrid popup dropdown from from a combobox Pin
Richard MacCutchan7-Nov-10 22:40
mveRichard MacCutchan7-Nov-10 22:40 
AnswerRead the instructions! (My vote of 1) Pin
OriginalGriff7-Nov-10 22:53
mveOriginalGriff7-Nov-10 22:53 
QuestionC# safe deployment (FOXPRO) Pin
michael_jhons7-Nov-10 9:07
michael_jhons7-Nov-10 9:07 
AnswerRe: C# safe deployment (FOXPRO) Pin
Eddy Vluggen8-Nov-10 1:04
professionalEddy Vluggen8-Nov-10 1:04 
QuestionMessage Removed Pin
7-Nov-10 7:32
ZeroOne87-Nov-10 7:32 

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.