473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help reading simple text file

HI,

I have this simple code below that writes my forms buttons name and
location to a text file.

What I am really struggling with is the code to read the information
back in form the text file and create and position a new button based
on the information.

Any Ideas?

Dim TW As System.IO.TextWriter
TW = System.IO.File.CreateText("C:\MyTextFile.txt")
Dim C As Control
For Each C In Me.Controls
If TypeOf C Is Button Then
TW.WriteLine(C.Text)
TW.WriteLine(C.Location)
End If
Next

Nov 24 '06 #1
1 1006
Marc,

Try to serialize your buttons, I have read this in past as original from Tom
Shelton in this newsgroup.
http://www.vb-tips.com/dbPages.aspx?...c-61641f5c8d9d

And don't forget to do this first with your buttons as he write here.
http://groups.google.com/group/micro...dc0d2aa?hl=en&

:-)

Cor

"Marc" <ma*********@hotmail.comschreef in bericht
news:11**********************@f16g2000cwb.googlegr oups.com...
HI,

I have this simple code below that writes my forms buttons name and
location to a text file.

What I am really struggling with is the code to read the information
back in form the text file and create and position a new button based
on the information.

Any Ideas?

Dim TW As System.IO.TextWriter
TW = System.IO.File.CreateText("C:\MyTextFile.txt")
Dim C As Control
For Each C In Me.Controls
If TypeOf C Is Button Then
TW.WriteLine(C.Text)
TW.WriteLine(C.Location)
End If
Next

Nov 25 '06 #2

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

Similar topics

2
by: Cergon | last post by:
hi, i hope someone can help. Im pretty new to this php stuff and i have a slight problem. I have this script (shown below) which writes data to a text file which is then displayed on my front...
6
by: KevinD | last post by:
assumption: I am new to C and old to COBOL I have been reading a lot (self teaching) but something is not sinking in with respect to reading a simple file - one record at a time. Using C, I am...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
2
by: devquest | last post by:
I have an xml file, and I need to convert it into a text file. xml: <?xml version="1.0" encoding="UTF-8" ?> - <po-response xmlns="http://seller.marketplace.sears.com/oms/v1"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...

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.