Hi, i am very new to VB. I am working on file operation such as show files, copy file, delete file, show current directory, rename folder, make folder.

My problem right now is with delete and copy file. I have a method of delete and copy but i dont know how to pass this method on a button.

Because we are told that each file operation should have a button for their specific purposes.

Here is my simple gui with 3 buttons which i have made so far. I am using vb2010.



http://www.flickr.com/photos/tiwnet/5964183989/


Public Sub DeleteFilesFromFolders(ByVal sourcePath As String)
If (Directory.Exists(DirPath)) Then
For Each fName As String In Directory.GetFiles(DirPath)
If File.Exists(fName) Then
File.Delete(fName)
End If
Next
End If
End Sub

Hope you could help me. tnx in advance.