Results 1 to 6 of 6

Thread: listview help

  1. #1

    Thread Starter
    Banned
    Join Date
    Mar 2008
    Posts
    24

    listview help

    HOW CAN I LOAD txt FILE IN listview?

  2. #2
    Lively Member
    Join Date
    Jun 2008
    Location
    Bayang Magiliw, Perlas Ng Silangan
    Posts
    100

    Re: listview help

    this code will give you a start. how about using richtextbox instead of listview?


    Code:
    strFileName = "C:\folder\File.txt"
    
    intFile = FreeFile
    Open strFileName For Input As #intFile
    Do While Not EOF(intFile)
        Line Input #intFile, strLineText
        ListView1.ListItems.Add 1, , strLineText
    Loop
    Close #intFile

  3. #3

    Thread Starter
    Banned
    Join Date
    Mar 2008
    Posts
    24

    Re: listview help

    yes its working thanks can u tell me how can i code i can took txt file from anywere jus click on load list and i took txt file from anywere thanks for ur tht code

  4. #4
    Lively Member
    Join Date
    Jun 2008
    Location
    Bayang Magiliw, Perlas Ng Silangan
    Posts
    100

    Re: listview help

    add component to your project :

    Project
    Components
    on Controls tab look for Microsoft Common Dialog Control 6.0

    double click Commondialog Control from the toolbox

    Code:
    Private Sub cmdLoadList_Click()
    
    Dim strFileName,strLineText As String
    
    CDialog.ShowOpen
    strFileName = CDialog.FileName
    
    If len(CDialog.FileName) < 1 Then
        MsgBox ("Select file from the list")
    Else
        intFile = FreeFile
        Open strFileName For Input As #intFile
        Do While Not EOF(intFile)
            Line Input #intFile, strLineText
    	ListView1.ListItems.Add 1, , strLineText
        Loop
        Close #intFile
    End If
    End Sub
    Last edited by nubie; Jun 26th, 2008 at 01:05 PM.

  5. #5

    Thread Starter
    Banned
    Join Date
    Mar 2008
    Posts
    24

    Re: listview help

    thanks its working 101 % ur realy good programmer thanks you and one kiss for u :-*

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: listview help

    Now that you have been helped, you could help us out. If you consider your question to be resolved please pull down the Thread Tools menu and click the Mark Thread Resolved menu item. That will let everyone know that you have your answer.

    Thank you.

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