How to determine the type of a derived class?

Hi:

To encapsulate data, I've subclassed several of the winform controls:

TextBox --> EWTextBox;
ComboBox --> EWComboBox;
ListBox --> EWListBox;

For generic handling, I store my derived controls in a list based on their common base class:
EWList<Forms.Control> ewTransactionUtilityControls = new EWList<.Forms.Control>();

Later, when I'm processing the list later, I would like to determine the derived class so I can do special processing according to the derived class type:

foreach( Control control in EWList)
{
     // Figure out whether "control" is an EWTextBox, EWComboBox, EWListBox
}

How do I do that?

LVL 1
jxbmaSoftware ConsultantAsked:
Who is Participating?
 
Babycorn-StarfishConnect With a Mentor Commented:
try

if( control is ClassName)
0
 
jxbmaSoftware ConsultantAuthor Commented:
Thanks man... I should have known this.
0
All Courses

From novice to tech pro — start learning today.