|
-
Sep 30th, 2000, 12:26 AM
#1
Thread Starter
Member
Hi
I have a listbox, with filenames
and when i click on a filename from
the listbox i want the File1 in the code
below to be replaced with the filename
from the listbox in the drop.
Dim Oldname
Dim Newname
Oldname = Dir1.Path & "\" & File1
Newname = Dir1.Path & "\" & List1
Name Oldname As Newname
File1.Refresh
Can someone please help me with this
question.
Thanks
Chris Davidsen
Christian Davidsen
If you go to sleep with an itchy
ass, you wake up with smelly fingers.
-
Sep 30th, 2000, 12:48 AM
#2
Lively Member
Dim Oldname
Dim Newname
Oldname = Dir1.Path & "\" & File1.filename
Newname = Dir1.Path & "\" & List1.List(List1.ListIndex)
Name Oldname As List1.List(List1.ListIndex)
FileCopy Newname, Oldname
File1.Refresh
-
Sep 30th, 2000, 01:28 AM
#3
Ok, I kind of got it, but you have to make sure a file is selected in the FileListBox.
Code:
'Author: Megatron
'Origin: http://forums.vb-world.net
'Purpose: Drag one list to the other
'Version: VB4+
'Comments (from me): Paying my respects and giving credit where it is needed, very good code as well
Dim StartDrag As Boolean
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
StartDrag = True
strTemp = List1.Text
End Sub
Private Sub List2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If StartDrag = True Then
List2.AddItem List1.Text
List1.RemoveItem List1.ListIndex
End If
StartDrag = False
End Sub
Took me a while to figure this out, but I think I may have found it:
Code:
Dim StartDrag As Boolean
Private Sub File1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Oldname
Dim Newname
If StartDrag = True Then
Oldname = Dir1.Path & "\" & File1
Newname = Dir1.Path & "\" & List1
Name Oldname As Newname
File1.Refresh
End If
StartDrag = False
End Sub
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
StartDrag = True
End Sub
-
Sep 30th, 2000, 10:59 AM
#4
Thread Starter
Member
wropng number of argument??
Hi
I tried your code
amd my code looks like this
--------------------------------------
Dim Oldname
Dim Newname
For i = 0 To List1.ListCount
Label1 = i
Oldname = Dir1.Path & "\" & File1.List(i).filename
Newname = Dir1.Path & "\" & List1.List(i)
Name Oldname As Newname
Next i
---------------------------------------
but it does not like File1.List(i), wrong argument
do you have any other clues
Thanks
Chris Davidsen
Christian Davidsen
If you go to sleep with an itchy
ass, you wake up with smelly fingers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|