Click here to Skip to main content
15,913,911 members
Home / Discussions / C#
   

C#

 
GeneralRe: TopMost property of a form Pin
Ruskin Dantra4-Dec-05 13:40
Ruskin Dantra4-Dec-05 13:40 
AnswerRe: TopMost property of a form Pin
Luis Alonso Ramos5-Dec-05 6:20
Luis Alonso Ramos5-Dec-05 6:20 
GeneralRe: TopMost property of a form Pin
Ruskin Dantra5-Dec-05 11:38
Ruskin Dantra5-Dec-05 11:38 
GeneralRe: TopMost property of a form Pin
Luis Alonso Ramos5-Dec-05 15:54
Luis Alonso Ramos5-Dec-05 15:54 
QuestionReference to simple types Pin
Yoyosch4-Dec-05 9:21
Yoyosch4-Dec-05 9:21 
AnswerRe: Reference to simple types Pin
Heath Stewart4-Dec-05 19:51
protectorHeath Stewart4-Dec-05 19:51 
QuestionCollections with different classes Pin
Mark064-Dec-05 8:03
Mark064-Dec-05 8:03 
AnswerRe: Collections with different classes Pin
Guffa4-Dec-05 9:52
Guffa4-Dec-05 9:52 
Avoid naming the class Object, or you will have to specify the full namespace every time you use it, as there is a class named Object in the System namespace.

You can either create a typed collection for objects of the base class, or use an untyped collection, like an ArrayList or a Hashtable. For a typed collection, you can use any member that you declared in the base class without type casting the objects. For an untyped collection, you have to type cast the objects to the base class or the specific class before using them.

To check the class of an object, you use the in operator:

if (anObject is Planet) {
((Planet)anObject).SomeMethod();
} else {
((SpaceStation)anObject).SomeOtherMethod();
}

---
b { font-weight: normal; }

GeneralRe: Collections with different classes Pin
Mark064-Dec-05 10:07
Mark064-Dec-05 10:07 
AnswerRe: Collections with different classes Pin
Guffa4-Dec-05 14:29
Guffa4-Dec-05 14:29 
QuestionMusic realtime analyser Pin
johboh4-Dec-05 4:53
johboh4-Dec-05 4:53 
AnswerRe: Music realtime analyser Pin
Guffa4-Dec-05 10:10
Guffa4-Dec-05 10:10 
GeneralRe: Music realtime analyser Pin
johboh5-Dec-05 21:37
johboh5-Dec-05 21:37 
AnswerRe: Music realtime analyser Pin
Guffa6-Dec-05 0:54
Guffa6-Dec-05 0:54 
QuestionDisabling MenuItems Pin
naglbitur4-Dec-05 4:19
naglbitur4-Dec-05 4:19 
AnswerRe: Disabling MenuItems Pin
dnewmon4-Dec-05 9:47
dnewmon4-Dec-05 9:47 
GeneralRe: Disabling MenuItems Pin
naglbitur4-Dec-05 10:07
naglbitur4-Dec-05 10:07 
GeneralRe: Disabling MenuItems Pin
mav.northwind5-Dec-05 3:10
mav.northwind5-Dec-05 3:10 
GeneralRe: Disabling MenuItems Pin
naglbitur5-Dec-05 7:05
naglbitur5-Dec-05 7:05 
AnswerRe: Disabling MenuItems Pin
mav.northwind5-Dec-05 7:18
mav.northwind5-Dec-05 7:18 
GeneralRe: Disabling MenuItems Pin
naglbitur6-Dec-05 2:06
naglbitur6-Dec-05 2:06 
AnswerRe: Disabling MenuItems Pin
André Ziegler5-Dec-05 4:04
André Ziegler5-Dec-05 4:04 
QuestionBackgroundWorker and ProgressBar Pin
SunsOfFun4-Dec-05 3:57
SunsOfFun4-Dec-05 3:57 
AnswerRe: BackgroundWorker and ProjessBar Pin
Rob Philpott4-Dec-05 4:40
Rob Philpott4-Dec-05 4:40 
GeneralRe: BackgroundWorker and ProjessBar Pin
SunsOfFun4-Dec-05 6:49
SunsOfFun4-Dec-05 6:49 

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.