Click here to Skip to main content
15,891,372 members
Home / Discussions / C#
   

C#

 
GeneralRe: User Validation Error Pin
Pete O'Hanlon4-Apr-08 8:49
mvePete O'Hanlon4-Apr-08 8:49 
QuestionPoint & Pixel Pin
nike_arh4-Apr-08 7:27
nike_arh4-Apr-08 7:27 
GeneralRe: Point & Pixel Pin
KaptinKrunch4-Apr-08 7:32
KaptinKrunch4-Apr-08 7:32 
GeneralRe: Point & Pixel Pin
nike_arh4-Apr-08 7:51
nike_arh4-Apr-08 7:51 
General.NET Remoting Pin
CodingYoshi4-Apr-08 7:21
CodingYoshi4-Apr-08 7:21 
GeneralMD5 checksum on unmanaged array Pin
bnb4-Apr-08 6:52
bnb4-Apr-08 6:52 
GeneralRe: MD5 checksum on unmanaged array Pin
CodingYoshi4-Apr-08 7:34
CodingYoshi4-Apr-08 7:34 
GeneralDisplay ArrayList in ListBox Pin
hbez4-Apr-08 5:40
hbez4-Apr-08 5:40 
On a windows for, after clicking a button, I add a class Student to an ArrayList with
ArrayList Grade10 = new ArrayList();
Grade10.Add(new Student(a, b, c, d, e); //Student declared as public class elsewhere
This seem to work fine.

However, I then want to load the items in a Listbox when another button is clicked. I use
foreach (Student i in Grade10)
lbxShow.Items.Add(" " + i);

I get message that Grade10 does not exist in this context. If I declare Grade10 again in this event it appears that the ArrayList is empty - program runs, no errors, empty ListBox.

All samples I find refer to console apps. These work for me but I cannot sort out the windows form - my first attempt at C#, I've been using Delphi for ages.
Seems I have to declare ArrayList Grade10 somewhere else (global?) so it is visible inside the second button event as well?
Much appreciate someone showing me the way.
Hannes
GeneralRe: Display ArrayList in ListBox Pin
Luc Pattyn4-Apr-08 5:50
sitebuilderLuc Pattyn4-Apr-08 5:50 
GeneralRe: Display ArrayList in ListBox Pin
phannon864-Apr-08 5:53
professionalphannon864-Apr-08 5:53 
GeneralRe: Display ArrayList in ListBox Pin
hbez4-Apr-08 6:08
hbez4-Apr-08 6:08 
GeneralRe: Display ArrayList in ListBox Pin
Luc Pattyn4-Apr-08 6:42
sitebuilderLuc Pattyn4-Apr-08 6:42 
GeneralRe: Display ArrayList in ListBox Pin
hbez4-Apr-08 20:12
hbez4-Apr-08 20:12 
QuestionListView.SelectedIndexChanged fired too much Pin
C-Scharbe4-Apr-08 5:26
C-Scharbe4-Apr-08 5:26 
GeneralRe: ListView.SelectedIndexChanged fired too much Pin
Luc Pattyn4-Apr-08 5:53
sitebuilderLuc Pattyn4-Apr-08 5:53 
GeneralRe: ListView.SelectedIndexChanged fired too much Pin
C-Scharbe4-Apr-08 5:59
C-Scharbe4-Apr-08 5:59 
GeneralRe: ListView.SelectedIndexChanged fired too much Pin
Luc Pattyn4-Apr-08 6:45
sitebuilderLuc Pattyn4-Apr-08 6:45 
GeneralRe: ListView.SelectedIndexChanged fired too much Pin
mav.northwind5-Apr-08 4:16
mav.northwind5-Apr-08 4:16 
GeneralRe: ListView.SelectedIndexChanged fired too much Pin
Luc Pattyn5-Apr-08 4:47
sitebuilderLuc Pattyn5-Apr-08 4:47 
GeneralRe: ListView.SelectedIndexChanged fired too much Pin
C-Scharbe6-Apr-08 22:26
C-Scharbe6-Apr-08 22:26 
GeneralRe: ListView.SelectedIndexChanged fired too much Pin
C-Scharbe6-Apr-08 22:24
C-Scharbe6-Apr-08 22:24 
GeneralRe: ListView.SelectedIndexChanged fired too much Pin
mav.northwind7-Apr-08 7:52
mav.northwind7-Apr-08 7:52 
QuestionRe: ListView.SelectedIndexChanged fired too much Pin
C-Scharbe16-Apr-08 4:20
C-Scharbe16-Apr-08 4:20 
QuestionHow to bind a list to a combobox Pin
baranils4-Apr-08 5:21
baranils4-Apr-08 5:21 
AnswerRe: How to bind a list to a combobox Pin
C-Scharbe4-Apr-08 5:39
C-Scharbe4-Apr-08 5:39 

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.