JumpyNET
Centurion
- Joined
- Apr 4, 2005
- Messages
- 196
I would like to compile and execute code at runtime and access the main form from the runtime code.
Visual Basic:
Public Class Form1
Public TestVariable As Integer = 7
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ExecuteTxtCode("Form1.TestVariable = 2") 'How should I alter this????
Me.Text = TestVariable 'Should be 2 and not the initial value of 7.
End Sub
Private Sub ExecuteTxtCode(ByVal Code As String)
'What should I put here????
End Sub
End Class