Reading a form control from a text file

G

Guest

Shown below is code for a very simple form. It has a single button that shows a "Hello World" message. I have this code in a file named: MyForm.tx

================================
Public Class Form
Inherits System.Windows.Forms.For
Private components As System.ComponentModel.IContaine
Friend WithEvents Button1 As System.Windows.Forms.Butto

Public Sub New(
MyBase.New(
Me.Button1 = New System.Windows.Forms.Butto
Me.Button1.Location = New System.Drawing.Point(8, 40
Me.Button1.Name = "Button1
Me.Button1.Size = New System.Drawing.Size(136, 23
Me.Button1.TabIndex =
Me.Button1.Text = "Show Message

'Form
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13
Me.ClientSize = New System.Drawing.Size(152, 107
Me.Controls.Add(Me.Button1
Me.Name = "Form1
Me.Text = "Form1
End Su

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clic
MsgBox("Hello World"
End Su
End Clas
============================

I would like to create another form that has a button, "Show Form" that a user can click. When it is clicked, I would like to read the MyForm.txt, somehow get it compiled and then displayed with a functional button that shows the "Hello World" message. Is something like this possible? If so, please point me to the .NET classes that can make this possible.
 

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