|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Execute something stored in a variableApril 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 "Mike TI" <sunset***@hotmail.com> schrieb: Dynamic compilation:> 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. Build a Custom .NET "EVAL" Provider <URL:http://www.eggheadcafe.com/articles/20030908.asp> Runtime Compilation (A .NET eval statement) <URL:http://www.codeproject.com/dotnet/evaluator.asp> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> 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 Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:%23shqakGZGHA.3740@TK2MSFTNGP03.phx.gbl... > "Mike TI" <sunset***@hotmail.com> schrieb: >> 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. > > Dynamic compilation: > > Build a Custom .NET "EVAL" Provider > <URL:http://www.eggheadcafe.com/articles/20030908.asp> > > Runtime Compilation (A .NET eval statement) > <URL:http://www.codeproject.com/dotnet/evaluator.asp> > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/>
How to extract multiple occurrences of a substring
Merging data received via TCP Finding A Record in a Dataset by index Textbox data entry validation Form1 can't getfocus again... Waiting for ThreadPool textbox enter or GotFocus Are there any tools that can generate call graph for Visual Basic .NET source codes? 77 lines code need 30MB ram ? Threading a form |
|||||||||||||||||||||||