Xenius
Erfahrenes Mitglied
hm unter VB .NEt gibtz keine File/Dir/DriveListBox mehr sondern nur noch eine ListBox, wenn ich aber eine solche brauche, was dann? wie mache ich das? Kann ich die ListBox irgendwie konfigurieren, so dass etwas ähnliches bei rauskommt?
Ich weiß man könnte das alles auch über einen öffnen Dialog machen...
Public Function ShowOpenDlg(F As Form, strFilter As String, _
strTitel As String, strInitDir As String) As String
Dim lngOpenFileName As OPENFILENAME
Dim lngAnt As Long
With lngOpenFileName
.lStructSize = Len(lngOpenFileName)
.hwndOwner = F.hWnd
.hInstance = App.hInstance
If Right$(strFilter, 1) <> "|" Then _
strFilter = strFilter + "|"
For lngAnt = 1 To Len(strFilter)
If Mid$(strFilter, lngAnt, 1) = "|" Then _
Mid$(strFilter, lngAnt, 1) = Chr$(0)
Next
.lpstrFilter = strFilter
.lpstrFile = Space$(254)
.nMaxFile = 255
.lpstrFileTitle = Space$(254)
.nMaxFileTitle = 255
.lpstrInitialDir = strInitDir
.lpstrTitle = strTitel
.flags = OFN_HIDEREADONLY Or OFN_FILEMUSTEXIST
lngAnt = GetOpenFileName(lngOpenFileName)
If (lngAnt) Then
ShowOpenDlg = Trim$(.lpstrFile)
Else
ShowOpenDlg = ""
End If
End With
End Function
aber das ist schließlich nicht Sinn der Sache.
mfg
Ich weiß man könnte das alles auch über einen öffnen Dialog machen...
Public Function ShowOpenDlg(F As Form, strFilter As String, _
strTitel As String, strInitDir As String) As String
Dim lngOpenFileName As OPENFILENAME
Dim lngAnt As Long
With lngOpenFileName
.lStructSize = Len(lngOpenFileName)
.hwndOwner = F.hWnd
.hInstance = App.hInstance
If Right$(strFilter, 1) <> "|" Then _
strFilter = strFilter + "|"
For lngAnt = 1 To Len(strFilter)
If Mid$(strFilter, lngAnt, 1) = "|" Then _
Mid$(strFilter, lngAnt, 1) = Chr$(0)
Next
.lpstrFilter = strFilter
.lpstrFile = Space$(254)
.nMaxFile = 255
.lpstrFileTitle = Space$(254)
.nMaxFileTitle = 255
.lpstrInitialDir = strInitDir
.lpstrTitle = strTitel
.flags = OFN_HIDEREADONLY Or OFN_FILEMUSTEXIST
lngAnt = GetOpenFileName(lngOpenFileName)
If (lngAnt) Then
ShowOpenDlg = Trim$(.lpstrFile)
Else
ShowOpenDlg = ""
End If
End With
End Function
aber das ist schließlich nicht Sinn der Sache.
mfg