There are a couple of methods you could choose from:
(1) Purchase a File View control (SkySoftware do one)
(2) Iterate until you create a directory name that does not exist, like
this:
Public Function GetUniqueFolder(ByVal theDirectory As String) As String
Dim theNewFolder as String = "New Folder"
Dim theCount As Integer = 0
Do
theCount += 1
Loop Until Not Directory.Exists(theDirectory & "\" & theNewFolder & " "
& theCount.ToString)
Return ( theDirectory & "\" & theNewFolder & " " & theCount.ToString )
End Function
This should iterate, adding a number to the end of each folder name, ie. :
New Folder 1
New Folder 2
New Folder 3
etc.......
until it finds one that does not exist, which is then your new folder name.
<tr**************@yahoo.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Hi all
I am having one application where i want to implement new feature that
is 'create new folder'. and display new folder name in listview.
My listview is editable.
My problem is i want to display unique folder name to the user at a
time of creating new folder.
That is if user click on 'create new folder' by default i am displaying
text as 'New folder'.
But i want this functionality to be same as that of windows explorer.
Does any one is having any idea about it.
Please help me.
Thanks in advance.