Results 1 to 5 of 5

Thread: [RESOLVED] from text file to listbox

  1. #1

    Thread Starter
    Addicted Member clownboy's Avatar
    Join Date
    Aug 2008
    Location
    Wellington, NZ
    Posts
    137

    Resolved [RESOLVED] from text file to listbox

    basically as the title says, however something undesirable is going on. I checked the text file and everything is in order, however when i run the loop (Following code) it puts the text into a list box fine, however the first line in the text file appears at the bottom of the listbox. Any ideas?


    Code:
    Public Sub FillListBox()
    
          Dim sFileText As String
          Dim iFileno As Integer
          Dim Ftitle As String
          Dim FMonth As String
          Dim FDay As String
          Dim EventDay As String
                
                
                FMonth = MonthName(Month(Now))
                FDay = DatePart("d", Now)
                EventDay = FMonth & "_" & FDay & ".txt"
       
          iFileno = FreeFile
    
            Open App.Path & "\logs\" & EventDay For Input As #iFileno
            While Not EOF(1)
              Line Input #1, sFileText
              Form1.List1.AddItem sFileText
            Wend
            Close #1
    
    End Sub

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: from text file to listbox

    Is the listbox sort property set to true?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Addicted Member clownboy's Avatar
    Join Date
    Aug 2008
    Location
    Wellington, NZ
    Posts
    137

    Re: from text file to listbox

    yes it is ^^

  4. #4

    Thread Starter
    Addicted Member clownboy's Avatar
    Join Date
    Aug 2008
    Location
    Wellington, NZ
    Posts
    137

    Re: from text file to listbox

    dont worry i see where this is going lol cheers

  5. #5

    Thread Starter
    Addicted Member clownboy's Avatar
    Join Date
    Aug 2008
    Location
    Wellington, NZ
    Posts
    137

    Re: [RESOLVED] from text file to listbox

    that it does lol
    Last edited by clownboy; Jun 19th, 2009 at 09:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width