H
Helmut Giese
Hello out there,
de-serializing a collection of controls I have code like this to
recreate them:
Control ctrl;
switch (type) {
case "Button": ctrl = new Button(); break;
case "Label": ctrl = new Label(); break;
// and loads more of these
}
Surely there is a "generic" way to create controls given the type -
but I don't arrive at a solution.
Any hints will be greatly appreciated.
Best regards
Helmut Giese
de-serializing a collection of controls I have code like this to
recreate them:
Control ctrl;
switch (type) {
case "Button": ctrl = new Button(); break;
case "Label": ctrl = new Label(); break;
// and loads more of these
}
Surely there is a "generic" way to create controls given the type -
but I don't arrive at a solution.
Any hints will be greatly appreciated.
Best regards
Helmut Giese