ukalyan
asked on
Convert a string to a method call
I have a form application with a "drop down list" and "Select button".
There are 3 functions
void foo1()
{
...
}
void foo2()
{
...
}
void foo3()
{
...
}
Is it possible to:
1) Convert method names to string so that these strings can be added to "drop down list" as "foo1", "foo2", "foo3"
2) Once a value is selected in the drop down, is it possible to change the selected string to method call:
i.e. "foo1" as foo1()
"foo2" as foo2()
"foo3" as foo3()
My basic understanding of C# says, it is not possible. But I want to find from experts, if there is a way to do this.
Thanks,
There are 3 functions
void foo1()
{
...
}
void foo2()
{
...
}
void foo3()
{
...
}
Is it possible to:
1) Convert method names to string so that these strings can be added to "drop down list" as "foo1", "foo2", "foo3"
2) Once a value is selected in the drop down, is it possible to change the selected string to method call:
i.e. "foo1" as foo1()
"foo2" as foo2()
"foo3" as foo3()
My basic understanding of C# says, it is not possible. But I want to find from experts, if there is a way to do this.
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.