Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
GeneralRe: Powerful Chart Control ? Pin
stancrm22-Nov-08 20:17
stancrm22-Nov-08 20:17 
GeneralRe: Powerful Chart Control ? Pin
Dave Kreskowiak23-Nov-08 4:44
mveDave Kreskowiak23-Nov-08 4:44 
QuestionHow to drag the panel on the form? Pin
Sokka9321-Nov-08 9:41
Sokka9321-Nov-08 9:41 
AnswerRe: How to drag the panel on the form? Pin
Ennis Ray Lynch, Jr.21-Nov-08 9:56
Ennis Ray Lynch, Jr.21-Nov-08 9:56 
GeneralRe: How to drag the panel on the form? Pin
Sokka9322-Nov-08 7:56
Sokka9322-Nov-08 7:56 
QuestionC# GridView Pin
Marywe21-Nov-08 9:07
Marywe21-Nov-08 9:07 
AnswerRe: C# GridView Pin
J$21-Nov-08 9:38
J$21-Nov-08 9:38 
Question'List' help ? Pin
nlowdon21-Nov-08 7:45
nlowdon21-Nov-08 7:45 
Evening all (depending where you are of course !)

This is going to be tricky to explain but i'll give it my best.
Please bear in mind i am a novice to C#.

I'm going to run a loop to create a 'List' of 10 animals.
I'm using polymorhism to then cast each animal the type i need (cat, dog, etc).

newAnimals[0] = new Cat();

newAnimals[1] = new Cat();


I'm confused as to how i can then give each object a reference name so that i can reference individual object's and invoke methods on them ?

For instance - say i had 5 animas in the list and the first 2 were cats.
I need to be able to say -

cat1.eat();

cat2.play();


Is there a way i can do this ?

Thanks in advance
(loving the forum by the way !!)
AnswerRe: 'List' help ? Pin
Pedram Behroozi21-Nov-08 8:10
Pedram Behroozi21-Nov-08 8:10 
AnswerRe: 'List' help ? Pin
Christian Graus21-Nov-08 8:56
protectorChristian Graus21-Nov-08 8:56 
GeneralRe: 'List' help ? Pin
nlowdon21-Nov-08 9:20
nlowdon21-Nov-08 9:20 
GeneralRe: 'List' help ? Pin
Christian Graus21-Nov-08 10:33
protectorChristian Graus21-Nov-08 10:33 
GeneralRe: 'List' help ? Pin
nlowdon21-Nov-08 12:35
nlowdon21-Nov-08 12:35 
GeneralRe: 'List' help ? Pin
User 665821-Nov-08 13:14
User 665821-Nov-08 13:14 
GeneralRe: 'List' help ? [modified] Pin
cor287921-Nov-08 13:31
cor287921-Nov-08 13:31 
GeneralRe: 'List' help ? Pin
Christian Graus21-Nov-08 20:54
protectorChristian Graus21-Nov-08 20:54 
QuestionDefining form client area Pin
Chris Copeland21-Nov-08 5:12
mveChris Copeland21-Nov-08 5:12 
AnswerRe: Defining form client area Pin
Rob Smiley21-Nov-08 6:03
Rob Smiley21-Nov-08 6:03 
GeneralRe: Defining form client area Pin
Chris Copeland21-Nov-08 6:17
mveChris Copeland21-Nov-08 6:17 
Questionthe efficieny consideration Pin
Seraph_summer21-Nov-08 3:28
Seraph_summer21-Nov-08 3:28 
AnswerRe: the efficieny consideration Pin
Ennis Ray Lynch, Jr.21-Nov-08 3:34
Ennis Ray Lynch, Jr.21-Nov-08 3:34 
QuestionForm Paint drawing incorrectly Pin
Chris Copeland21-Nov-08 3:14
mveChris Copeland21-Nov-08 3:14 
AnswerRe: Form Paint drawing incorrectly Pin
Ennis Ray Lynch, Jr.21-Nov-08 3:35
Ennis Ray Lynch, Jr.21-Nov-08 3:35 
GeneralRe: Form Paint drawing incorrectly Pin
Chris Copeland21-Nov-08 3:49
mveChris Copeland21-Nov-08 3:49 
GeneralRe: Form Paint drawing incorrectly Pin
Ennis Ray Lynch, Jr.21-Nov-08 3:57
Ennis Ray Lynch, Jr.21-Nov-08 3:57 

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.