B
boxim
hi all,
If i've got an object which is of type MyTextBox which is derived from
System.Windows.Forms.TextBox, then in another class i want to check the type
of the control passed to one if methods, i.e
public void DoSomethingWithControl(System.Windows.Forms.Control _control) {
if (_control.GetType()==typeof(System.Windows.Forms.TextBox) {
// will not be true if i pass my object derived from
TextBox - not of type TextBox. How do i compare derived types?
}
}
TIA
Sam Martin
If i've got an object which is of type MyTextBox which is derived from
System.Windows.Forms.TextBox, then in another class i want to check the type
of the control passed to one if methods, i.e
public void DoSomethingWithControl(System.Windows.Forms.Control _control) {
if (_control.GetType()==typeof(System.Windows.Forms.TextBox) {
// will not be true if i pass my object derived from
TextBox - not of type TextBox. How do i compare derived types?
}
}
TIA
Sam Martin