Execute something stored in a variable

M

Mike TI

April 20, 2006

Hi All

Thank you every one for your help, I have now started to get the feel of
VB.Net 2005.

How can I execute something stored in a variable.

For example, I want to store:

UserControl1.Show() or
UserControl2.Show()

in a variable and then execute whatever is in that variable.

Thanks in advance.
Mike TI
 
M

Mike TI

April 22, 2006

Thank you for your reply. I found the example very difficult to understand
as I am very new to VB.Net.

Incidently, I read about the System.CodeDom namespace in MSDN, however I am
unable to get the example given to work. Does this do what I have in mind ?

*****
Dim start As New CodeEntryPointMethod()
Dim cs1 As New CodeMethodInvokeExpression( _
New CodeTypeReferenceExpression("System.Console"), _
"WriteLine", _
New CodePrimitiveExpression("Hello World!") )
start.Statements.Add(cs1)
*****

Please assist
Mike Ti
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top