Change type of control by type
Posted
by Ruben
on Stack Overflow
See other posts from Stack Overflow
or by Ruben
Published on 2010-03-30T10:48:58Z
Indexed on
2010/03/30
10:53 UTC
Read the original article
Hit count: 576
Hi, I'm having following problem. I should convert a control to a certain type, this can be multiple types (for example a custom button or a custom label, ....) Here's an example of what i would like to do:
private void ConvertToTypeAndUseCustomProperty(Control c)
{
Type type = c.getType();
((type) c).CustomPropertieOfControl = 234567;
}
Thanks in advance.
© Stack Overflow or respective owner