Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Divider Line In Menus

Hey there,

I have a sys tray icon with right-click menu, and I was wondering if I can put up some horizontal divider lines between some menu items, to make it look a little cleaner, or maybe just a space or something.

Any ideas? I searched but couldn't find anything (anyone know how to combine keywords with AND? For some reason it doesn't work in search...or is it just me?)


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How Do U Add A Gray Divider Line To An RTB?
How do you add a Gray divider line to an to a RichTextBox?
Like the ones you see between procedures in the VB6 IDE.

I did it once by accident but have no idea what I did

"Divider" Line In TreeView Control?
Hi Gurus,

I have a TreeView control in which the user can rearrange nodes at the same "level" by dragging and dropping them. For example, if I had the tree below...

[-] Parent1
+--- Child1
+--- Child2
+--- Child3

...the user could drag Child3 up to Child1 (but not past Parent1), which would then reorder the nodes as Child3, Child1, Child2.

Anyway, my real question is this: is there any way to use an API call or something to draw a line between the nodes indicating where the selected node will be dropped (similar to the line that is drawn when you drag a Favorites shortcut up and down in the Favorites menu of IE)?

Right now I just use the DropHighlight to indicate the node in front of which the dragged node will be dropped, but an "inter-nodal" line would be more intuitive, I think. If it's a big pain in the butt (or it can't even be done) then I'll just live with the way it is now.


Vertical Divider
In a lot of programs like Outlook and the VB design environment you can resize certain panels to set their width so that you can see all the text that appears in them. You do this just by simple dragging and dropping. As you do so a thin semi-transparent bar appears indicating where the edge of the panel will appear when you drop. Has anyone got any code for doing this? The difficulty I have is that I want the bar to appear over an MDI form's blank area and over its child forms, so I've really got to draw on the screen, and I don't know how to do this.

Text Divider
Yes, I am a newbie, and yes, I have searched the forum.
AND yes, I have checked the help-file.

Now, my question:

I want to start a new line in my text box, what is the code?

Can you out it in an easy example, so I can understand the whole thing and how to use it?

It would be great!

Divider In A Listbox

I am looking for a divder in a listbox control or something, I wish to have the same look as in Filemanager in win9x where you can move the display area of files, dates and such.

What control does that and how do I use it ?


****Menu U Bar Divider Lines
How do i add the dividers into a vb menu??

i know its there somewhere but buggered if i can see it

MAIN Caused Divider Error

I get the below message while running my vb application on Windows 98.

MAIN caused a divide error in module <unknown> at 0000:00000204.
EAX=00000000 CS=003b EIP=00000204 EFLGS=00000097
EBX=00000000 SS=3b6f ESP=00000fd0 EBP=00007772
ECX=00000001 DS=5b26 ESI=311777e2 FS=3117
EDX=00000000 ES=3117 EDI=00000000 GS=1fae
Bytes at CS:EIP:
cd 30 cd 30 cd 30 cd 30 cd 30 cd 30 cd 30 cd 30
Stack dump:
003b0204 c11d0004 02460347 3117772e 008e0002 1fae0000 16b70000 12c016b7 023717b7 022f01b7 00280032 003b0204 00000001 00000026 00000031 00000000

Once the program reaches this point, it ends the application or freezes the system. It is not caused by a run-time bug as all errors have been trapped in all the modules.

Could someone provide me with a solution to fix this problem.



Trouble With 1000 Divider (number Formating)
i have text boxes where user suppose to enter numerical values, which are used for calculation.
to make it look nicer, i want to format content of text box into standart format #,##0.00 (usa/canada regional setting).
however, after this formating is done, the field with calculated result changes and uses only digits before 1000 separator. for example after 10000 is formated into 10,000.00 formula is recalculated with the value 10.

here is part of my code (sbttl2, other, etc are defined as double):

Private Sub txtOther_Change()
On Error Resume Next
other = Val(txtOther.Text)
sbttl2 = instal + other + sprep + sinst + permit + superv
txtSub2.Text = Format(sbttl2, "#,##0.00")
End Sub

Private Sub txtOther_LostFocus()
On Error Resume Next
txtOther.Text = Format(txtOther.Text, "#,##0.00")
If Len(txtOther.Text) < 1 Then
txtOther.Text = 0
End If
End Sub

any suggestion, please?

Keeping A Child Window's Menus From Replacing A MDI Parent's Menus
I'm trying to have a word object that is a child object of my MDI window. I switched the Negotiate Toolbars property on the MDI parent to false, but there does not seem to be a property for Negotiate Menus on the MDI parent (there is for the child window). How do I keep the word object's menu bar from replacing my MDI parent window's menu bar.


Icons On Menus With Owner-Drawn Menus
Hello, Ive been checking Gerret Sever's Owner-Drawn Menus and his module is quite useful, I was wondering how could I add more bmps to the list already there? for instance we have:

gMenuBmps.Add Array(101, 102), "Open" ' IDs in resource... 101 = pic, 102 = mask
gMenuBmps.Add Array(103, 104), " Save" ' IDs in resource... 103 = pic, 104 = mask

but I want to add one more bmp to that array, is anyone familiar with the code? Ive seen a lot of references to it around here...


Whats The Easiest Way To Add Menus Sub Menus After Your Project Is Done?
Ok I'm a Stooge,
I wrote my program all out works perfect, thanks to the poster on but now I want to ad menus like file edit view etc what the easiest way to do this?

Problem With Popup Menus And Negotiate Menus
I have a from (an MDI child form) and I wanted to add a popup menu to a Listview in that form. I create the menu on that MDI child form and set the NegotiateMenus property to False. The problem is: I have also a menu on the MDI form and when I open the MDI child form, the child's form menu *replaces* the MDI form menu!
How can I solve that?? I want the MDI menu always, I only create the menu on the MDI child to use it as a PopUp menu. No matter the value of NegotiateMenus, it keeps doing that.
I'll appreciate any help.

Line Input #1, Do I Read Ahead One Line (or Back Up One Line)
I am loading a file line by line using the LIne Input but at one point i need to look ahead at the next line to decided what to do on the current do i look ahead one line? or how do i use the line Input function and then back up? Any help would be greatly appreciated.

Shane Thomas
p.s. please email replys in addition to the reply of post too

Menus, Menus, How Do U Work ?

my qstns all have something to do with menus.

ok, the first qstn: i want to add something to the right-click menu that comes, for example, when you right-click an item on the desktop. I also want an icon next to it...

next on my menu - there it is again.. :

i want to have a button, which once pressed will display a menu like the File menu at the top of a window. the menu has to be right next to the command button (in the middle of the form)

and finally, can u change the bgrnd colour of a menu?

ok, i lied. not ALL my questions have something to do with menus...

how do u add a file association. by that, i mean, when a file with my extension comes, i want it to change to my app's icon (like a *.zip file will have the winzip icon...)

it probably has something to do with the registry, and i know how to add stuf to the registry, but i have no idea where to add the file association stuff and was wondering if some1 has the code handy...

well, that was the biggest post ive ever made...


Line By Line Text File Read And Correct Each Line
Can anyone help me create a small program or have any pointers
on pieces of code that reads a text file from folder "unfixed" then
fix the contents and then store the corrected contents
in another folder "fixed" and then move the file in folder "unfixed" to folder "old"

Details of contents.
There is a space infront of each line that should be removed.
Between the first group of numbers and the second there should be a zero for every space.
Then after the second group of numbers there should be just one space and the rest trimed off.

011531015222360000500355 3350505212004 50122
011531015222360000500363 5336305212004 6255
011531015222360000503465 2404505212004 50022
011531015222360000503463 1345205212004 50025
02153101522236 13 1503256

The @ symbol represents where a space should be.
I would like to read the file and then correct it and then
place the fixed contents in another folder with the original name.
Below is how I would like it to look.


Replacing A Line Of Text With A Blank Line, Then Delete That Line
The code below works perfect, retrieving the string of text that the user selects from the listview. Then I do bla bla bla. What I want to do is convert this so that the the user selects a string from the listview which corresponse to a string in the file. then click remove. my problem is, how do i remove a line of text from a text file? if i open for reading i cant modify the contents, if i open for writing it erases the data. and i dont want to write the data into a string, parse out the string that i don't want then rewrite the file.... that could be....not so good...

'the line that actually is in the file..
i want to remove this line...
Dim strSelected As String
strSelected = lvwAccounts.ListItems(lvwAccounts.SelectedItem.Index)

Dim objFSO As New FileSystemObject
Dim objFile As File
Dim objTS As TextStream
Dim strReadline As String
Dim strFind As String
Dim strData As String
Dim strEmail As String
Dim blnFound As Boolean

Set objFile = objFSO.GetFile(App.Path & "pop3a.txt")
Set objTS = objFile.OpenAsTextStream(ForReading)
Do Until objTS.AtEndOfStream Or blnFound = True
'reads line in file
strReadline = objTS.ReadLine
strFind = "="
strData = (InStr(1, strReadline, strFind) + 1)
strEmail = Mid(strReadline, strData)
If strEmail = lvwAccounts.SelectedItem.Text Then
frmEdit.txtEmail = strEmail
blnFound = True
End If
- Gabe

Loading Dynamic Menus Within Dynamic Menus
We have a situation where some of our menus have become extremely long (upwards of 50 items) and are becoming unusable as a result. I've been asked to checnge our menu program so that, if there are more than 15 items it will group them into sub menus. Sound reasonably easy but I just can't quite seem to do it. I've been able to group the first 15 together by using the following algorithm:-

VB Code:
while moreRowsToAdd 'this is actually a while not eof statement against a recordset   fnCreateMenu(rcsTmp("description")) 'this dynamically loads a menu item and returns it   Let intMenuCount = intMenuCount + 1   If intMenuCount = mconMaxToolbarMenuOptions Then      'we need to add a sub menu and move all of the last 15 items onto it      'or we need to add a new menu at this level and continue to load into that one      For lp2 = 1 To mconMaxToolbarMenuOptions         'get the new sub option menu         Set mnuTmp2 = fnGetSubMenuItem(lp2) 'this routine loads a new sub menu item dynamically and returns it.         'get the existing menu         Set mnuTmp = fnGetMenuItem(lp2)          'copy the details across         Let mnuTmp2.Caption = mnuTmp.Caption         'unload the existing (and now unwanted) menu         Unload mnuTmp      Next lp2      Set mnuTmpHeader = fnGetMenuItem(intXpos, intYpos, 0, False)      Let mnuTmpHeader.Caption = "Page 1"    End Ifwend

So my menu structure at design time is to have an indexed menu item with an indexed sub menu item below it. Under normal circumstances it just dynamically loads as many menus as it needs. It always leaves menuItem(0) as blank and then hides it later in the program.

However, if it reaches 15 menu items it then starts loading sub menu items and copying the details of the current 15 menu items across. It then unloads the menu items as it no longer need them and renames menuItem(0), which now contains the 15 sub menu items, to "Page 1". This is fine and working so far.

The problem is that the next 15 items need to be loaded into Page 2, then Page 3 and so on. I can't seem to achieve this because Page 2 would presumably equate to menuItem(1), page 3 to menuItem(2) and so on. But at design time subMenuItem(0) can only exist in one place, i.e. under menuItem(0). So if I just keep loading subMenuItems they all appear under Page 1 which defeats the point of doing this in the first place.

I've tried creating menuItem(0) to menuItem(9) at design time and then creating subMenuItem0(0) to subMenuItem9(0) under them respectively but, since I need to do this with several menus, I eventually reach the point where VB reports tha I can't create any more controls on the form.

Does anyone have another suggestions?

Calling Popup Menus From Popup Menus
Okay this will probably seem pointless to most but what the hell, is it possible to call a TOTALLY different popup menu from another popup menu (and im not talking about submenus!)???
Another question, can you set the position on the screen where the popup menu appears???

Needing Experienced Programmer For Help - Parsing && Changing Line By Line In Txt File

I'm a senior in HS and needing some help parsing a text file.

I have this in the text file:

ProjectList(0) = ""
ProjectList(1) = "A015"
ProjectList(2) = "A049"
ProjectList(3) = "A052"
ProjectList(4) = "C033"
ProjectList(5) = "C035"
ProjectList(6) = "C036"
ProjectList(7) = "C039"
ProjectList(8) = "E001"
ProjectList(9) = "E017"
ProjectList(10) = "E018"
ProjectList(11) = "E025"
ProjectList(12) = "G076"
ProjectList(13) = "G079"
ProjectList(14) = "H007"
ProjectList(15) = "H012"
ProjectList(16) = "K253"
ProjectList(17) = "M002"
ProjectList(18) = "M036"
ProjectList(19) = "M042"
ProjectList(20) = "M043


The problem is that if i add another entry, for example, ProjectList(16) = "K254" it has to be in sequential order/alphabetical order. Well, I need to be able to add a line, and then from there renumber the rest of the projectlist items, from that item down.. Because if you add one, say at ProjectList(2), it messes up the order.. No big deal you say...but the rest of the file goes to 138 records and everytime you have to renumber it by hand...I'd like to automate this..

I have tried using Split function in VB, filter, Replace function, but I can't seem to break apart each line, increment the number, and then do that the same for the rest of the file, all while being able to have this functionality work no matter where or what number in the sequence it is.... If anybody could guide me, I would be indebted... Thanks!!

I have attached a text file of it if anybody needs to see what I'm talking about...

Prevent Multi Line Textbox From Wrapping Incomplete Words To The Following Line

I've created a textbox that will mimic a mainframe screen that has a dimension of 80 X 24.

The following textbox properties are set as follows:
Multiline = True
Word wrap = True

When a user enters text into this textbox the text will wrap after every 80 characters, just like it would when typing on a mainframe screen.

PROBLEM: I would like the textbox to wrap only complete words to the next line...just like this forum textbox that I am typing into right now does..
would anyone know the code to accomplish this?

Thanks in advance..

MsgBox Showing All Multi-line Footnotes That Have Carriage Return At End Of Line
Can I tell Word via VBA to show me all the footnotes that erroneously
have a carriage return at the end of multi-line footnotes. ?
To be more specific there are still people who press enter at the end
of a written line instead of let Word do the line break

The MsgBox should say for example:

Footnote 1: carriage return, page 7
Footnote 2: carriage return, page 9

Could please somebody give me a hint ? Thank you very much in



Leading Spaces Of Each Line Ina Multi-line DataReport Field Has Been Trimmed
I have a multi-line textbox that update a SQL table field. However, when printing the field in a datareport, all leading spaces of each lines has been trimmed, just like all lines left-aligned. Is there any settings I need to set, or this is a bug of datareport? I got this problem in VB6 SP4 & SP5.
I've checked that the spaces have been saved in the SQL rec.
Moreover, I found that I put a multi-line textbox to a datareport label gets the same result.
Thx for your help.

Read, Find A Line And Delete The Line In Text File
Hi, I am writing codes to do the following things: read a line from a text file, if this is a matched line, delete the line and go to the next line.

Can any one give me some direction? Such as access mode, method to use, etc.


Getting Current Line And Position On Line For Regular And RichText Boxes.
Just like in Notepad for windows, I'd like to know how to get the line number and "column" if you will that is currently selected in a text box or rich text. The method should be fairly fast as some text files opened are > 300 kb. Thanks in advance

How To Display Second Line If The First Line In Text File Is Meet The Condition
Dear All,
Would you please tell me how to display second line if the first line in text file is meet the condition. I am using VB.NET.
I would appreciate your helps very much,

.Input ( Read Contentsof Text File - Line By Line )
I'm trying to import Data from a text file, which includes the following,

Vessel Name

The above file is updated every five minutes and I wish to retreive this data in
order to perform calc's and then display a completion time for a process on the
User Form.

Open "YourFile.txt" For Input As #1
While Not EOF(1)
Input #1, YourVariable
List1.Additem YourVariable
Close #1

Instead of adding to a list as in the above example, I want to process it Line by
Line ( How do I achieve this using .Input ).


Reading A Tab Delimited Text File Line By Line Into An Array
I have a tab delimited file created by an outside source.
I am using the below code to read it's contents into an array.

Function openFile()
Dim FileNum As Integer
Dim TotalFile As String

FileNum = FreeFile
' Reads the entire file into memory all at once
Open "c:DBUpdaterpgstd.txt" For Binary As #FileNum
TotalFile = Space(LOF(FileNum))
Get #FileNum, , TotalFile
Close #FileNum
TotalFile = Replace(TotalFile, vbNewLine, vbTab)
Fields = Split(TotalFile, vbTab)

'For X = 1 To UBound(Fields) Step 1
' Now the array can be used in the mdb comparing
'Debug.Print Fields(X)

End Function

My issue is that I am trying to read the array in lots of 15 as the text file has 15 columns of data.

Some of the lines only have 4 columns of data, this is throwing out my retrieval process.

Here is a sample of the text file. (copy and paste into a text file read it correctly)

10P1Computer Systems
40ZCOB9939XW6200 DUAL 3.2GHZ, 1GB, 40GB SATANO INTEGRATED GRAPHICSPO_3371793900.004290.0010.0
50ZCOD2329T5710 800MHZ 256/256 XPE THIN CLNTMicrosoft Windows XP Embedded; MS IE 6.0Transmeta Crusoe 800 MHz ; PC540A13.12671.38738.52772.73850.0010.0

Line two only has 5 tabs then the next line starts, this obviously throws out my reading of fields.

However this file can be imported into Access and all columns are correct, so I know it can be done, just not with my limited VB knowledge.

please Help,


Line Input #n,,&lt;string&gt; Stops When [null] Is In The Line
VB6. Using line input #n,,<string. to read a file. It is a txt file and the records are variable length and may contain CTRL characters. When I read a record that has a [null] in it, it takes that as a CRLF and terminates the read. I therefore get a short record and the next record read is the continuation of the first one. My reading tells me that CRLF is the terminator of a record not [null]. A stumper for me. And yes, I am sure there is no CRLF AFTER the null. I read the record character at a time and it is a null all by its lonesome.

Question is: How can I read this record FULLY at one time. I then have to go through and change the null to a space, so it has to be in the record, otherwise everything would shift.

Get Line Form Text File 1 Line At A Time
I am trying get some code that will get one line of txt from a file then after it done with that line grab the next line so on and so forth. I have been able to get it to run through a file but I canít get to do it one at a time. Here is some of the code I am trying to using now.

Sub TextStream ()

Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, _
TristateFalse = 0

Dim fs, f, ts, s

Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(Form1.Dialog.FileName)
Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)

Call count1 ' Mycounter1

If Mycounter1 = Mycounter2 Then


Call count2 ' Mycounter2

s = ts.ReadLine
Form1.Text1.Text = s

End If

End Sub

Trouble Reading Line By Line From A Text File
This is what i have in a text file:

1ZOOMETRIC (12) S J MILLER (56)$ 6.70$ 6.20$ 4.70$ 4.90$ 2.40
2SHIRAZAMATAZZ (6) D J STAECK (56)$ 4.00$ 4.30$ 4.30$ 4.40$ 2.00
3CONSPIRATOR (3) G L SMITH (56)$21.80$20.60$22.20$22.70$ 6.20
4KING CANUTE (11) J S WHITING (56)$44.50$47.90$50.10$53.10$10.00
5WOOL ZONE (9) P KING (56)$22.50$20.50$22.40$21.40$ 5.70

This is the code I have:

Open "c:Test.txt" For Input As #2
Do While Not EOF(2)
Line Input #2, strLine
If Len(strLine) > 30 Then
a = Len(strLine) - 11
b = Mid(strLine, a, 5)
End If
Close #2

txtOutput.Text = b

I'm trying to get it to read a line and then put the result in a RichTextBox.
Then read the next line and put the result in the RichTextBox, and so on.

The code i have only returns the result from the last line ignoring the rest e.g. "21.40"


Capture Api Line Images And Image.line Question
how do i capture picture of my graph plotted by the polyline function(attachment below) and can anyone tell me more about image1.line command and how do i draw circle on an imagebox.

How Can I Read One Line By One Line From A Multiline Text Field ?
i have a few rows of data on the text box

is there anyway to do this ?

Richtextbox : How To Change/set A Line Position To Move The Line Up/down?
I want to write a line in a Richttextbox at a specific desired Position vertically, like in a picturebox.

For a picturebox to change the print position

Private Sub Command1_Click()
Picture1.CurrentY = 100
Picture1.Print "test" ' this prints the text beginning from y axis of
' 100 pixels down.
End Sub
How can I do the same for a RTBox?
(I dont mean a newlinefeed.)

If there is a solution for this, then I should place a text in a RTBox at
any position.

Ensuring Only 65 Chars Per Line In Multi Line Textbox
I have a text box that can have any number of lines, but each line can only have 65 characters (I'm using the SendMessage API). A blank space is treated the same as a character. Right now I'm adding a carriage return at every 66th character, which works fine if I don't go back and insert or change anything I already typed in. When I do try that the cursor gets put the end of all of the text in the text box. The only way to change any text is to back space to the point where I want to retype something.
I'm curious to know if anyone can give me some ideas about how I should go about doing this.

I'll post my code and you will see why I get pushed to the end of the text
Private Const EM_LINELENGTH = &HC1
charcount = SendMessage(txtDetails.hwnd, EM_LINELENGTH, txtDetails.SelStart, ByVal 0&)
txtDetails.Text = Left$(txtDetails.Text, InStrRev(txtDetails.Text, " ")) & vbCrLf & Mid$(txtDetails.Text, InStrRev(txtDetails.Text, " ") + 1)
txtDetails.SelStart = Len(txtDetails.Text)

Read File Line By Line, Populate Listbox
How can I read a text file line by line, and for each line, make a new row in the listbox?

Put Specified Line By Line Number Of A Text File Into String
All I need is to put a specified line of text from a text file (by line number) into a string. Thanks

Edit: Ill explain better


open "cool.txt" for input as #1
getline 3, string '<--- puts line 3 into a string called "string"
close #1

Something to that effect. Thanks again.

Reading File Line By Line With Comma's In Lines
how is this does? I need to read line by line where each line has aprox about 30+ comma's.

currently tried using

Open App.Path & "monster.txt" For Input As #1
While Not EOF(1)
Input #1, line
dbObj.Execute (line)
Close #1

Read A Word In A Line Of Text And Delete That Line
I have some aim logs that I'm going to put in .txt format, and I want to be able to delete the text that the other person has written.

Is there a way for me to specify a screen name and have the program delete that line of text?


New Line (vbCrLf) Leaves Symbol? / New Line Alternatives?
Hi I have a form that reads and writes date to and from a text file. The data is inputted in text boxes on the forum. At the end of reach set of records I want it to create a new line in the text file. When using vbCrLf it works but when viewing the form I get a symbol after the data that is in that textbox:

Thankyou for any help

How To Read Rich Text Box Content Line By Line
Hi all. I got a rich text box and i wonder how i can read each line of it one by one. For example i want to read each line of it and display it in massage box.
Furthermore, if i have 10 line of content in textbox how i can refrence each line and display it in massage box?

I be happy if some one show me how this can be done.Thanks

Reading A Text File Line By Line For Spellcheck
i am building a word processor. i want to build a fairly basic spellchecker. i will create a txt file with a line by line list of words that can be used and want to check each word against this. i can get a array with all the words in the program and the txt file with the dictionary in it. anyone point me in the right direction on how do this. possibly in a loop but not sure. Thanks

Send Line By Line From A Richtextbox With Brake Between Each [Solved]
Here the program I have in mind

lets say my form has one richtext box. and the user types in the first line something then hits enter goes to the second line, ect....

How I for example make it so that, when the user hits a command button, it will messege the first line, then take a 1 second brake then send the second line take 1 second brake ect...

MsgBox "line 1"
delay (1)
MsgBox "line 2"
delay (1)
MsgBox "line 3"
delay (1)

ect... is it posible


Loading Lines From A Text File Line By Line
I need to be able to load a line from a text file, perform actions on the line then read out the next line and perform the same actions each time adding the text to a text box, so that by the end the text box will contain all the information from the text file but formatted as to how my code formats it.

My Knowledge of VB is quite limited so explanations of how to use any code posted will probably be needed.

Thanks in advance

Extract Line By Line Of String Freom RichTextBox ..
anyone know how to do this????

i hope to extract line by line from Rich Text Box..... just like how the "line input" works ....

i have search through the forum but no one ever done this

Run Time Error When Read File Line By Line
I'm trying to read a txt file line by line that I can stop reading at any place I want.
Below is the code:

VB Code:
Do While Not EOF(1)  Line Input #1, fString     Text1.Text = Text1.Text + fString + vbCrLfLoop

The problem is, if the txt file has empty lines at the end of it, it will have run time error : "Input past end of file".
Does anyone know how to solve this problem?
Thanks in advance!

Faster To Read Line By Line, Or Whole File And Then Process?
Which is faster: Opening a file line by line... or creating a dynamic arr() and get the whole file, split at new line, and put it into the array, then use the array?

* RESOLVED * Reading A File Line By Line Problem.
I'm reading a file and adding each line into a listview. I use InStr and Mid to take the first part of each line only, e.g. the text before the space. A typical line in the text file would be something similar to this:

breakers "Breakers Revenge"

In the above line, just the first part breakers is taken, which is exactly what I want. But some lines have a comma in like this:

galmidwo "Galaxian (Midway, old rev)"

In this line I want to take galmidwo which it does, but then it puts in the word "old" for the next line.

The problem I am having is that any line with a comma is treated as two lines (I think). So how can I stop this?

Dim strText As String

Open "listfull.txt" For Input As #1

Do While Not EOF(1)
Input #1, strText
pos = InStr(1, strText, " ")
strText = Mid(strText, 1, pos)
Set LItem = ListView.ListItems.Add(, , strText)
Close #1


Reading TextFiles Line By Line (Need To Know How To With Opening A File)
I have it setup to save the entries 1 entry per line. Now I don't know how to input the stuff in by each line. I need to do a loop as to where it will take the data from each line and put it in the appropriate textbox from each line. Please post how to do this. I have been having some problems with this.

Rich Textbox - Making A Given Line The Top Line Displayed
This is the short-and-sweet version of a question I posted earlier. Is there a way to make a given line in the rich textbox the first line displayed? (For example, if I want to display line #53 as the top line, is there a combination of methods/properties I can use to do this? I can't find any obvious technique.)

Copyright © 2005-08, All rights reserved