Click here to Skip to main content
16,018,234 members
Home / Discussions / C#
   

C#

 
AnswerRe: Inheritance on ListViewSubItem, BackColor Pin
led mike28-Nov-07 10:00
led mike28-Nov-07 10:00 
GeneralRe: Inheritance on ListViewSubItem, BackColor Pin
T.Willey28-Nov-07 10:57
T.Willey28-Nov-07 10:57 
QuestionA container for jenerics Pin
feod00728-Nov-07 7:58
feod00728-Nov-07 7:58 
AnswerRe: A container for jenerics Pin
Ennis Ray Lynch, Jr.28-Nov-07 8:42
Ennis Ray Lynch, Jr.28-Nov-07 8:42 
GeneralRe: A container for jenerics Pin
feod00728-Nov-07 9:07
feod00728-Nov-07 9:07 
AnswerRe: A container for jenerics Pin
Luc Pattyn28-Nov-07 9:19
sitebuilderLuc Pattyn28-Nov-07 9:19 
GeneralRe: A container for generics Pin
feod00728-Nov-07 12:38
feod00728-Nov-07 12:38 
GeneralRe: A container for generics Pin
Luc Pattyn28-Nov-07 21:30
sitebuilderLuc Pattyn28-Nov-07 21:30 
Hi,

1.
you can retrieve an object from any ArrayList, then check its type, e.g.

object obj=list[0];
Button btn=obj as Button; // gives either a real Button or null
if (btn!=null) btn.PerformClick();


2.
ArrayList does not care about the types of objects it is holding.
A generic collection such as List<T> is different:
- it will only accept objects of type T (or derived from T)
- it will automatically return objects of type T, without needing a cast
(making it both safer and faster).

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]


this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets


GeneralRe: A container for generics [modified] Pin
feod00729-Nov-07 0:24
feod00729-Nov-07 0:24 
Questionprint a local rdlc report without showing Pin
Gulfraz Khan28-Nov-07 6:41
Gulfraz Khan28-Nov-07 6:41 
AnswerRe: print a local rdlc report without showing Pin
Anthony Mushrow28-Nov-07 6:46
professionalAnthony Mushrow28-Nov-07 6:46 
AnswerRe: print a local rdlc report without showing Pin
Giorgi Dalakishvili28-Nov-07 6:51
mentorGiorgi Dalakishvili28-Nov-07 6:51 
GeneralRe: print a local rdlc report without showing Pin
Gulfraz Khan29-Nov-07 3:03
Gulfraz Khan29-Nov-07 3:03 
QuestionGridview nested in Repeater Data Issue Pin
kgarl28-Nov-07 6:00
kgarl28-Nov-07 6:00 
QuestionDateTimePicker Pin
tthellebuyck28-Nov-07 5:40
tthellebuyck28-Nov-07 5:40 
AnswerRe: DateTimePicker Pin
Luc Pattyn28-Nov-07 5:46
sitebuilderLuc Pattyn28-Nov-07 5:46 
GeneralRe: DateTimePicker Pin
tthellebuyck28-Nov-07 9:26
tthellebuyck28-Nov-07 9:26 
QuestionVariable visibility in subclasses... Pin
devzav28-Nov-07 5:32
devzav28-Nov-07 5:32 
AnswerRe: Variable visibility in subclasses... Pin
Anthony Mushrow28-Nov-07 5:37
professionalAnthony Mushrow28-Nov-07 5:37 
GeneralRe: Variable visibility in subclasses... Pin
devzav28-Nov-07 5:43
devzav28-Nov-07 5:43 
AnswerRe: Variable visibility in subclasses... Pin
Guffa28-Nov-07 7:48
Guffa28-Nov-07 7:48 
GeneralRe: Variable visibility in subclasses... Pin
devzav29-Nov-07 3:55
devzav29-Nov-07 3:55 
GeneralRe: Variable visibility in subclasses... Pin
Guffa29-Nov-07 4:05
Guffa29-Nov-07 4:05 
GeneralRe: Variable visibility in subclasses... Pin
devzav29-Nov-07 5:17
devzav29-Nov-07 5:17 
QuestionCombo box Foriegn key problem Pin
sajid.salim.khan28-Nov-07 5:07
sajid.salim.khan28-Nov-07 5:07 

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.