VERSION 5.00 Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX" Begin VB.Form frmInput BorderStyle = 3 'Fixed Dialog Caption = "Selectie inputbestand (profiellijnen)" ClientHeight = 2535 ClientLeft = 45 ClientTop = 435 ClientWidth = 11880 ControlBox = 0 'False Icon = "frmInput.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 2535 ScaleWidth = 11880 ShowInTaskbar = 0 'False StartUpPosition = 2 'CenterScreen Begin MSComDlg.CommonDialog openBestand Left = 6240 Top = 1920 _ExtentX = 847 _ExtentY = 847 _Version = 393216 FileName = "c" End Begin VB.CommandButton cmdEinde Caption = "&Stop" Height = 495 Left = 9960 TabIndex = 3 ToolTipText = "Klik op OK om verder te gaan" Top = 1920 Width = 1815 End Begin VB.Frame Frame4 Caption = "Geselecteerd inputbestand slootprofielen" Height = 855 Left = 120 TabIndex = 2 Top = 960 Width = 11655 Begin VB.CommandButton cmdOpenBestandSloten Caption = "..." Height = 375 Left = 11040 TabIndex = 7 Top = 315 Width = 495 End Begin VB.TextBox txtInputBestandSloten Height = 285 Left = 120 TabIndex = 5 Top = 360 Width = 10815 End End Begin VB.CommandButton cmdOK Caption = "OK >>" Height = 495 Left = 7920 TabIndex = 0 ToolTipText = "Klik op OK om verder te gaan" Top = 1920 Width = 1815 End Begin VB.Frame Frame2 Caption = "Geselecteerd inputbestand profielen" Height = 855 Left = 120 TabIndex = 1 Top = 120 Width = 11655 Begin VB.CommandButton cmdOpenBestandProfielen Caption = "..." Height = 375 Left = 11040 TabIndex = 6 Top = 315 Width = 495 End Begin VB.TextBox txtInputBestandProfielen Height = 285 Left = 120 TabIndex = 4 Top = 360 Width = 10815 End End End Attribute VB_Name = "frmInput" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub cmdEinde_Click() 'Stop het programma End End Sub Private Sub cmdOk_Click() 'Declareer tijdelijkervariable Dim temp, i As Integer ' 'Controleer eerst of er een bestand is gekozen ' If inputBestand = "" Then ' temp = MsgBox("Selecteer eerst een invoerbestand alvorens verder te gaan", vbInformation, "Let op!") ' Exit Sub ' End If inputBestand = txtInputBestandProfielen.Text inputBestandSloot = txtInputBestandSloten.Text 'Unload het formulier frmInput Unload frmInput 'Laad het formulier frmLaden en frmGraphicView frmLaden.Show frmGraphicView.Show 1 End Sub Private Sub Command2_Click() End Sub Private Sub cmdOpenBestandProfielen_Click() Dim tempInputBestand As String 'Sets the Dialog Title to Open File titleMenu = "Open DAM Edit profiellijnenbestand" 'Selecteer bronbestand tempInputBestand = openBestanden(titleMenu) txtInputBestandProfielen.Text = tempInputBestand End Sub Private Sub cmdOpenBestandSloten_Click() Dim tempInputBestand As String 'Sets the Dialog Title to Open File titleMenu = "Open DAM Edit slotenbestand" 'Selecteer bronbestand tempInputBestand = openBestanden(titleMenu) txtInputBestandSloten.Text = tempInputBestand End Sub Function openBestanden(ByVal titleOpenDialog As String) As String Dim myString As String 'Sets the Dialog Title to Open File openBestand.DialogTitle = titleOpenDialog 'Definieer setting file dialog venster 'Sets the File List box to csv files openBestand.Filter = "DAM Ditch Input files - with header (*.csv)|*.csv" 'Set the default files type to csv files openBestand.FilterIndex = 1 'Sets the flags - File must exist and Hide Read only openBestand.Flags = cdlOFNFileMustExist + cdlOFNHideReadOnly 'Set dialog box so an error occurs if the dialogbox is cancelled openBestand.CancelError = True ' Enables error handling to catch cancel error On Error Resume Next ' display the dialog box openBestand.ShowOpen If Err Then ' This code runs if the dialog was cancelled MsgBox "Geen bestandsnaam geselecteerd" Exit Function End If 'Bewaar de bestandsnaam in de functie variabele openBestanden = openBestand.FileName myString = openBestanden pathInvoerbestand = (Mid$(myString, 1, InStrRev(myString, "\"))) End Function