473,480 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Reading a form control from a text file

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.
Nov 20 '05 #1
1 972
Hi,

Maybe this is what you are looking for.
http://windowsforms.net/articles/wfml.aspx

Ken
------------------
"GeneJoe" <an*******@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com...
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.txt

=================================
Public Class Form1
Inherits System.Windows.Forms.Form
Private components As System.ComponentModel.IContainer
Friend WithEvents Button1 As System.Windows.Forms.Button

Public Sub New()
MyBase.New()
Me.Button1 = New System.Windows.Forms.Button
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 = 0
Me.Button1.Text = "Show Message"
'
'Form1
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 Sub

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

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.

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4409
by: Nomen Nescio | last post by:
can anyone be so kind as to look at http://www.mysolution.ws/HYPOCRITE.php and let me know why it isn't passing the form data to http://www.mysolution.ws/insertHYPOCRITES.php for the most...
6
16850
by: David Gray | last post by:
Greetings all, I'm working on a program that allows a user to enter notes in a multiline textbox. I would like to be able to read the contents of the textbox (as records - one per line) and...
1
6736
by: Magnus | last post by:
allrite folks, got some questions here... 1) LAY-OUT OF REPORTS How is it possible to fundamentaly change the lay-out/form of a report in access? I dont really know it that "difficult", but...
0
1765
by: Juan Galdeano | last post by:
Hi, I'm working on an ONIX project and when I try to validate or read XML files C# gives me this exception: System.IndexOutOfRangeException at System.Xml.XmlScanner.ScanDtdContent() at...
2
2457
by: Sabin Finateanu | last post by:
Hi I'm having problem reading a file from my program and I think it's from a procedure I'm using but I don't see where I'm going wrong. Here is the code: public bool AllowUsage() { ...
2
1823
by: Mad Scientist Jr | last post by:
i'm trying to read a file byte by byte (and later alter the data and write it to a 2nd file byte by byte) and running into a problem where it seems to keep reading the same byte over and over again...
3
1784
by: lizii | last post by:
i have a file - which on each line has some data i need to fill into a box - now although reading in the data is simple enough and putting it in the correct box will be no problem, as i can just...
13
1912
by: Marc | last post by:
The first part of the below writes the name and location of all buttons on a from to a text file. The second part reads that information back in and recreates the buttons. My problem is reading...
1
1640
by: ChrisFrohlich | last post by:
ASP.NET 2.0 with Text DataTypes: I've got a similar question going in the SQL group, but I was wondering if anyone has successfully implemented reading/writing character data from a Text datatype...
0
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7032
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7076
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.