Forum Sementara Putera.com

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Forum Sementara Putera.com

Bersama kita perkemaskan forum ini sementara forum asal dalam pemulihan.

Forum putera dah kembali. Masalah sudah berjaya diselesaikan. Sila lawati http://forum.putera.com/tanya


    macam mane nak refresh filelistbox;vb6

    avatar
    edrilKacak
    Ahli Baharu
    Ahli Baharu


    Number of posts : 5
    Registration date : 19/01/2010

    macam mane nak refresh filelistbox;vb6 Empty macam mane nak refresh filelistbox;vb6

    Post by edrilKacak Wed Feb 10, 2010 9:53 am

    salam,

    kat bawah nie ialah satu sistem utuk copy files dari local folder ke shared folder.mcm mane nak refresh filelistbox tu so that setiap kali aku copy certain file ke shared folder,ia kan refresh kat filelistbox.Contohnya lau aku copy file 'a' dari drive c aku ke shared folder bernama zmyxxxxx,after copying,aku nak makesure dalam filelistbox tu , file 'a' tak wujud lagi dah.so takdelah kes user terselect file yg same lagi dah

    Private Sub cmdCpy_Click()

    Dim path As String
    Dim topath As String
    Dim File As String
    Dim directory As String

    On Error GoTo err_handler:

    directory = txtdest.Text
    File = FileListBox.FileName
    path = DirListbox + "\" + File
    topath = directory + "\" + File

    If txtdest.Text <> "" Then
    FileCopy path, topath



    MsgBox " file succesfully copied"

    Else
    MsgBox "please specify target destination"

    End If

    Kill path
    Exit Sub
    err_handler:
    MsgBox ("Failed. " & Error)
    End Sub

    Private Sub DirListbox_Change()
    FileListBox.path = DirListbox.path
    End Sub

    Private Sub DriveListBox_Change()
    Dim msg As String
    Dim result As String

    On Error GoTo Error
    DirListbox.path = DriveListBox.Drive
    Exit Sub

    Error: msg = "Error: " & Err.Number & ": " & Err.Description
    result = MsgBox(msg, vbOKCancel + vbExclamation, "No Data")

    If result = vbOK Then
    Resume
    Else
    DriveListBox.Drive = DirListbox.path
    Err.Clear
    Exit Sub
    End If

    End Sub

    Private Sub FileListBox_Click()


    lblFile.Caption = FileListBox.FileName
    End Sub

      Current date/time is Wed May 08, 2024 4:18 pm