VERSION 5.00 Begin VB.Form frmInput BorderStyle = 3 'Fixed Dialog Caption = "Selectie inputbestand (profiellijnen)" ClientHeight = 8430 ClientLeft = 45 ClientTop = 435 ClientWidth = 11910 Icon = "frmInput.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 8430 ScaleWidth = 11910 ShowInTaskbar = 0 'False StartUpPosition = 2 'CenterScreen Begin VB.CommandButton cmdWis Caption = "W&is selectie" Height = 495 Left = 2040 TabIndex = 13 ToolTipText = "Klik op OK om verder te gaan" Top = 7800 Width = 1815 End Begin VB.CommandButton cmdEinde Caption = "&Stop" Height = 495 Left = 9960 TabIndex = 12 ToolTipText = "Klik op OK om verder te gaan" Top = 7800 Width = 1815 End Begin VB.CommandButton cmdSelect Caption = "S&electeer bestand" Height = 495 Left = 120 TabIndex = 11 ToolTipText = "Klik op OK om verder te gaan" Top = 7800 Width = 1815 End Begin VB.Frame Frame4 Caption = "Geselecteerd inputbestand slootprofielen" Height = 615 Left = 120 TabIndex = 9 Top = 6240 Width = 11655 Begin VB.Label lblBestandSloot AutoSize = -1 'True Caption = "-" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 120 TabIndex = 10 Top = 240 Width = 75 End End Begin VB.Frame Frame3 Caption = "1e regel uit het inputbestand" Height = 615 Left = 120 TabIndex = 7 Top = 7080 Width = 11655 Begin VB.Label lblIndeling AutoSize = -1 'True Caption = "-" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00C00000& Height = 195 Left = 120 TabIndex = 8 Top = 240 Width = 75 End End Begin VB.CommandButton cmdOK Caption = "OK >>" Enabled = 0 'False Height = 495 Left = 8040 TabIndex = 4 ToolTipText = "Klik op OK om verder te gaan" Top = 7800 Width = 1815 End Begin VB.Frame Frame2 Caption = "Geselecteerd inputbestand profielen" Height = 615 Left = 120 TabIndex = 5 Top = 5400 Width = 11655 Begin VB.Label lblInputbestand AutoSize = -1 'True Caption = "-" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00C00000& Height = 195 Left = 120 TabIndex = 6 Top = 240 Width = 75 End End Begin VB.Frame Frame1 Caption = "Selecteer het inputbestand" Height = 4935 Left = 120 TabIndex = 0 Top = 240 Width = 11655 Begin VB.FileListBox File1 Height = 4185 Left = 3720 Pattern = "*.txt;*.xyz;*.asc" TabIndex = 3 ToolTipText = "Selecteer hier het bestand" Top = 480 Width = 7815 End Begin VB.DirListBox Dir1 Height = 3690 Left = 120 TabIndex = 2 ToolTipText = "Selecteer hier de map" Top = 960 Width = 3495 End Begin VB.DriveListBox Drive1 Height = 315 Left = 120 TabIndex = 1 ToolTipText = "Selecteer hier de (netwerk) drive" Top = 480 Width = 3495 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 'Unload het formulier frmInput Unload frmInput 'Laad het formulier frmLaden en frmGraphicView frmLaden.Show frmGraphicView.Show End Sub Private Sub Command2_Click() End Sub Private Sub cmdSelect_Click() 'Selecteer bestand, afhankelijk van welke actief is: If lblInputbestand.Caption = "-" Then helpFileName = File1.FileName inputBestand = File1.Path + "\" + helpFileName lblInputbestand.Caption = inputBestand lblIndeling.Caption = "-" File1.Pattern = "*.csv" Else helpFileName = File1.FileName inputBestandSloot = File1.Path + "\" + helpFileName lblBestandSloot.Caption = inputBestandSloot cmdSelect.Enabled = False cmdOK.Enabled = True End If End Sub Private Sub cmdWis_Click() 'Wis de selectie lblInputbestand.Caption = "-" inputBestand = "" lblBestandSloot.Caption = "-" inputBestandSloot = "" cmdSelect.Enabled = True cmdOK.Enabled = False lblIndeling.Caption = "-" File1.Pattern = "*.txt;*.asc;*.xyz" End Sub Private Sub Dir1_Change() 'Update de file structuur als het path wordt veranderd File1.Path = Dir1.Path End Sub Private Sub Drive1_Change() Dim i As Integer Dim tempDrive 'Set error trap On Error GoTo errorHandler 'Update de dir structuur als de drive wordt veranderd Dir1.Path = Drive1.Drive 'Voorkom dat de errorHandler zonder reden wordt uitgevoerd Exit Sub 'Trap errorHandler: 'Toon waarschuwing i = MsgBox("Kan niet lezen vanaf het geselecteerde station, kies een ander station", vbCritical, "Leesfout!") End Sub Private Sub File1_Click() 'Declareer lokale variabelen Dim helpFileName 'Voor selectie bestandsnaam Dim textRegel '1e regel uit het geselecteerde bestand Dim tempInputBestand As String 'Variabele voor het tonen van de bestandsnaam 'Set error trap On Error GoTo errorHandler 'Bewaar de geselecteerde bestandsnaam helpFileName = File1.FileName tempInputBestand = File1.Path + "\" + helpFileName kadeTraject = helpFileName 'Open bestand Open tempInputBestand For Input As #1 'Lees de 1e regel uit het bestand Line Input #1, textRegel 'Toon de eerste regel uit het bestand lblIndeling.Caption = textRegel 'sluit bestand Close #1 'Voorkom dat de errorHandler zonder reden wordt uitgevoerd Exit Sub 'Trap errorHandler: 'Toon waarschuwing lblIndeling.Caption = "Onbekend format, selecteer een geschikt bestand" 'sluit bestand Close #1 End Sub Private Sub File1_DblClick() 'Declareer tijdelijkervariable Dim temp 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 'Unload het formulier frmInput Unload frmInput 'Laad het formulier frmLaden en frmGraphicView frmLaden.Show frmGraphicView.Show End Sub