Click here to Skip to main content
15,916,379 members
Home / Discussions / C#
   

C#

 
AnswerRe: Rename file Pin
Mycroft Holmes21-Nov-08 13:25
professionalMycroft Holmes21-Nov-08 13:25 
GeneralRe: Rename file Pin
netJP12L22-Nov-08 5:22
netJP12L22-Nov-08 5:22 
GeneralRe: Rename file Pin
Mycroft Holmes22-Nov-08 14:39
professionalMycroft Holmes22-Nov-08 14:39 
AnswerRe: Rename file Pin
Thomas Stockwell21-Nov-08 15:32
professionalThomas Stockwell21-Nov-08 15:32 
AnswerRe: Rename file Pin
Dave Kreskowiak21-Nov-08 18:57
mveDave Kreskowiak21-Nov-08 18:57 
QuestionPowerful Chart Control ? Pin
stancrm21-Nov-08 11:22
stancrm21-Nov-08 11:22 
AnswerRe: Powerful Chart Control ? Pin
Mycroft Holmes21-Nov-08 13:29
professionalMycroft Holmes21-Nov-08 13:29 
GeneralRe: Powerful Chart Control ? Pin
Dr.Walt Fair, PE22-Nov-08 10:27
professionalDr.Walt Fair, PE22-Nov-08 10:27 
GeneralRe: Powerful Chart Control ? Pin
Mycroft Holmes22-Nov-08 14:46
professionalMycroft Holmes22-Nov-08 14:46 
GeneralRe: Powerful Chart Control ? Pin
Dr.Walt Fair, PE22-Nov-08 14:58
professionalDr.Walt Fair, PE22-Nov-08 14:58 
GeneralRe: Powerful Chart Control ? Pin
Mycroft Holmes22-Nov-08 15:50
professionalMycroft Holmes22-Nov-08 15:50 
GeneralRe: Powerful Chart Control ? Pin
Dr.Walt Fair, PE22-Nov-08 16:53
professionalDr.Walt Fair, PE22-Nov-08 16:53 
GeneralRe: Powerful Chart Control ? Pin
Mark Churchill23-Nov-08 12:35
Mark Churchill23-Nov-08 12:35 
AnswerRe: Powerful Chart Control ? Pin
Dave Kreskowiak21-Nov-08 18:52
mveDave Kreskowiak21-Nov-08 18:52 
GeneralRe: Powerful Chart Control ? Pin
stancrm22-Nov-08 0:25
stancrm22-Nov-08 0:25 
GeneralRe: Powerful Chart Control ? Pin
Dave Kreskowiak22-Nov-08 4:18
mveDave Kreskowiak22-Nov-08 4:18 
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 

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.