16. september 2000 - 22:44Der er
14 kommentarer og 1 løsning
dumme commondlg
Jeg bruger API CommonDialog, og nu spørger jeg, hvordan i alverden kan man få CommonDialog til at spytte hvor den valgte fil\'s mappe er henne (den kan, hos mig, kun sige hele stigen (dvs. eks. C:\\hello.txt, men jeg vil kun have C:\\) HVORDAN??
For I=1 To Len(CommonDialog1.filename) Sti=Right$(CommonDialog1.filename,I) If Left$(Sti,1)=\"\\\" Then Exit For Next I Sti = Right$(Commondialog.filename,I-1)
For I=1 To Len(CommonDialog1.filename) Sti=Right$(CommonDialog1.filename,I) If Left$(Sti,1)=\"\\\" Then Exit For Next I Sti = Left$(Commondialog1.filename,Len(Commondialog1.filename)-I)
Public Function GetFilePath(ByVal FullFilePath As String, Optional ByVal AddSlash As Boolean = False) As String Dim nPos As Integer Dim sTmp As String
nPos = InStrRev(FullFilePath, \"\\\") If nPos > 1 Then sTmp = Left(FullFilePath, nPos - 1) If AddSlash Then sTmp = sTmp & \"\\\" GetFilePath = sTmp End If End Function
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.