Who can help? Im a starting vb programmer and i have the following problem. I'm making an application that convert comma seperate files, to another type of the same files with a different name.
The user must give a source file or directory (if the choose to convert more than one file)and a target directory and next to the textbox I made a button for browsing, wich has to browse files if they select one file convert, or browse directories if they selected complete directory convert. Now the most things work except for that browse buttons. How can i make that button work ?? do i need to imports things or what. I have the code for the main form inserted under this. I tried a lot of things from samples, but i still can't get it working.
existing code:
Imports System
Imports System.IO
Public Class FrmMain
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar
Friend WithEvents progress As System.Windows.Forms.GroupBox
Friend WithEvents Hoofdmenu As System.Windows.Forms.MainMenu
Friend WithEvents MenuBestand As System.Windows.Forms.MenuItem
Friend WithEvents MenuNieuw As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Friend WithEvents MenuAfsluiten As System.Windows.Forms.MenuItem
Friend WithEvents MenuHelp As System.Windows.Forms.MenuItem
Friend WithEvents MenuOver As System.Windows.Forms.MenuItem
Friend WithEvents MenuAuteur As System.Windows.Forms.MenuItem
Friend WithEvents MenuProddate As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem18 As System.Windows.Forms.MenuItem
Friend WithEvents MenuVersion As System.Windows.Forms.MenuItem
Friend WithEvents ButConv As System.Windows.Forms.Button
Friend WithEvents tbDoelbest As System.Windows.Forms.TextBox
Friend WithEvents LblDoelbest As System.Windows.Forms.Label
Friend WithEvents tbBronbest As System.Windows.Forms.TextBox
Friend WithEvents LblBronbest As System.Windows.Forms.Label
Friend WithEvents LblResult As System.Windows.Forms.Label
Friend WithEvents RbutConvall As System.Windows.Forms.RadioButton
Friend WithEvents LblConvKeuze As System.Windows.Forms.Label
Friend WithEvents RbutConv1 As System.Windows.Forms.RadioButton
Friend WithEvents LblCopyright As System.Windows.Forms.Label
Friend WithEvents LblProgress As System.Windows.Forms.Label
Friend WithEvents MenuItemleeg1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItemleeg2 As System.Windows.Forms.MenuItem
Friend WithEvents ButAcceptBron As System.Windows.Forms.Button
Friend WithEvents PbLogo1 As System.Windows.Forms.PictureBox
Friend WithEvents PBlogo2 As System.Windows.Forms.PictureBox
Friend WithEvents ButBladeren1 As System.Windows.Forms.Button
Friend WithEvents ButBladeren2 As System.Windows.Forms.Button
Friend WithEvents FolderBrowserDialog1 As System.Windows.Forms.FolderBrowserDialog
Friend WithEvents Lblresultaat As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FrmMain))
Me.ButConv = New System.Windows.Forms.Button
Me.tbDoelbest = New System.Windows.Forms.TextBox
Me.LblDoelbest = New System.Windows.Forms.Label
Me.tbBronbest = New System.Windows.Forms.TextBox
Me.LblBronbest = New System.Windows.Forms.Label
Me.LblResult = New System.Windows.Forms.Label
Me.RbutConvall = New System.Windows.Forms.RadioButton
Me.LblConvKeuze = New System.Windows.Forms.Label
Me.RbutConv1 = New System.Windows.Forms.RadioButton
Me.PbLogo1 = New System.Windows.Forms.PictureBox
Me.LblCopyright = New System.Windows.Forms.Label
Me.ProgressBar1 = New System.Windows.Forms.ProgressBar
Me.progress = New System.Windows.Forms.GroupBox
Me.LblProgress = New System.Windows.Forms.Label
Me.Hoofdmenu = New System.Windows.Forms.MainMenu
Me.MenuBestand = New System.Windows.Forms.MenuItem
Me.MenuNieuw = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
Me.MenuAfsluiten = New System.Windows.Forms.MenuItem
Me.MenuItemleeg1 = New System.Windows.Forms.MenuItem
Me.MenuHelp = New System.Windows.Forms.MenuItem
Me.MenuItemleeg2 = New System.Windows.Forms.MenuItem
Me.MenuOver = New System.Windows.Forms.MenuItem
Me.MenuAuteur = New System.Windows.Forms.MenuItem
Me.MenuProddate = New System.Windows.Forms.MenuItem
Me.MenuItem18 = New System.Windows.Forms.MenuItem
Me.MenuVersion = New System.Windows.Forms.MenuItem
Me.ButAcceptBron = New System.Windows.Forms.Button
Me.PBlogo2 = New System.Windows.Forms.PictureBox
Me.ButBladeren1 = New System.Windows.Forms.Button
Me.ButBladeren2 = New System.Windows.Forms.Button
Me.FolderBrowserDialog1 = New System.Windows.Forms.FolderBrowserDialog
Me.Lblresultaat = New System.Windows.Forms.Label
Me.progress.SuspendLayout()
Me.SuspendLayout()
'
'ButConv
'
Me.ButConv.BackColor = System.Drawing.Color.Lime
Me.ButConv.Enabled = False
Me.ButConv.Font = New System.Drawing.Font("Arial Black", 12.0!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ButConv.Location = New System.Drawing.Point(568, 336)
Me.ButConv.Name = "ButConv"
Me.ButConv.Size = New System.Drawing.Size(152, 48)
Me.ButConv.TabIndex = 26
Me.ButConv.Text = "Converteer !"
'
'tbDoelbest
'
Me.tbDoelbest.Location = New System.Drawing.Point(248, 272)
Me.tbDoelbest.Name = "tbDoelbest"
Me.tbDoelbest.Size = New System.Drawing.Size(472, 23)
Me.tbDoelbest.TabIndex = 25
Me.tbDoelbest.Text = ""
Me.tbDoelbest.Visible = False
'
'LblDoelbest
'
Me.LblDoelbest.Location = New System.Drawing.Point(48, 272)
Me.LblDoelbest.Name = "LblDoelbest"
Me.LblDoelbest.Size = New System.Drawing.Size(176, 24)
Me.LblDoelbest.TabIndex = 24
Me.LblDoelbest.Text = "Geef het doelbestand op : "
Me.LblDoelbest.Visible = False
'
'tbBronbest
'
Me.tbBronbest.Location = New System.Drawing.Point(248, 136)
Me.tbBronbest.Name = "tbBronbest"
Me.tbBronbest.Size = New System.Drawing.Size(472, 23)
Me.tbBronbest.TabIndex = 23
Me.tbBronbest.Text = ""
Me.tbBronbest.Visible = False
'
'LblBronbest
'
Me.LblBronbest.Location = New System.Drawing.Point(48, 136)
Me.LblBronbest.Name = "LblBronbest"
Me.LblBronbest.Size = New System.Drawing.Size(176, 24)
Me.LblBronbest.TabIndex = 22
Me.LblBronbest.Text = "Geef het bronbestand op : "
Me.LblBronbest.Visible = False
'
'LblResult
'
Me.LblResult.Location = New System.Drawing.Point(48, 368)
Me.LblResult.Name = "LblResult"
Me.LblResult.Size = New System.Drawing.Size(304, 152)
Me.LblResult.TabIndex = 21
'
'RbutConvall
'
Me.RbutConvall.Location = New System.Drawing.Point(40, 72)
Me.RbutConvall.Name = "RbutConvall"
Me.RbutConvall.Size = New System.Drawing.Size(120, 24)
Me.RbutConvall.TabIndex = 20
Me.RbutConvall.Text = "Alle Bestanden"
'
'LblConvKeuze
'
Me.LblConvKeuze.Location = New System.Drawing.Point(40, 24)
Me.LblConvKeuze.Name = "LblConvKeuze"
Me.LblConvKeuze.Size = New System.Drawing.Size(168, 16)
Me.LblConvKeuze.TabIndex = 19
Me.LblConvKeuze.Text = "Wat wilt u converteren ?"
'
'RbutConv1
'
Me.RbutConv1.Location = New System.Drawing.Point(40, 48)
Me.RbutConv1.Name = "RbutConv1"
Me.RbutConv1.Size = New System.Drawing.Size(120, 24)
Me.RbutConv1.TabIndex = 18
Me.RbutConv1.Text = "Eén Bestand"
'
'PbLogo1
'
Me.PbLogo1.Image = CType(resources.GetObject("PbLogo1.Image"), System.Drawing.Image)
Me.PbLogo1.Location = New System.Drawing.Point(672, 8)
Me.PbLogo1.Name = "PbLogo1"
Me.PbLogo1.Size = New System.Drawing.Size(160, 48)
Me.PbLogo1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PbLogo1.TabIndex = 17
Me.PbLogo1.TabStop = False
'
'LblCopyright
'
Me.LblCopyright.Location = New System.Drawing.Point(8, 592)
Me.LblCopyright.Name = "LblCopyright"
Me.LblCopyright.Size = New System.Drawing.Size(152, 16)
Me.LblCopyright.TabIndex = 15
Me.LblCopyright.Text = "©2005 by M.J. Maas"
'
'ProgressBar1
'
Me.ProgressBar1.Location = New System.Drawing.Point(496, 464)
Me.ProgressBar1.Name = "ProgressBar1"
Me.ProgressBar1.Size = New System.Drawing.Size(208, 16)
Me.ProgressBar1.TabIndex = 14
'
'progress
'
Me.progress.AccessibleRole = System.Windows.Forms.AccessibleRole.ProgressBar
Me.progress.Controls.Add(Me.LblProgress)
Me.progress.Location = New System.Drawing.Point(480, 424)
Me.progress.Name = "progress"
Me.progress.Size = New System.Drawing.Size(240, 72)
Me.progress.TabIndex = 16
Me.progress.TabStop = False
'
'LblProgress
'
Me.LblProgress.Location = New System.Drawing.Point(72, 24)
Me.LblProgress.Name = "LblProgress"
Me.LblProgress.Size = New System.Drawing.Size(88, 24)
Me.LblProgress.TabIndex = 0
Me.LblProgress.Text = "Progress Bar"
'
'Hoofdmenu
'
Me.Hoofdmenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuBestand, Me.MenuItemleeg1, Me.MenuHelp, Me.MenuItemleeg2, Me.MenuOver})
'
'MenuBestand
'
Me.MenuBestand.Index = 0
Me.MenuBestand.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuNieuw, Me.MenuItem3, Me.MenuAfsluiten})
Me.MenuBestand.Text = "&Bestand"
'
'MenuNieuw
'
Me.MenuNieuw.Index = 0
Me.MenuNieuw.Text = "&Nieuw Conversie"
'
'MenuItem3
'
Me.MenuItem3.Index = 1
Me.MenuItem3.Text = "-"
'
'MenuAfsluiten
'
Me.MenuAfsluiten.Index = 2
Me.MenuAfsluiten.Text = "&Afsluiten"
'
'MenuItemleeg1
'
Me.MenuItemleeg1.Enabled = False
Me.MenuItemleeg1.Index = 1
Me.MenuItemleeg1.Text = ""
'
'MenuHelp
'
Me.MenuHelp.Index = 2
Me.MenuHelp.Text = "&Help"
'
'MenuItemleeg2
'
Me.MenuItemleeg2.Enabled = False
Me.MenuItemleeg2.Index = 3
Me.MenuItemleeg2.Text = ""
'
'MenuOver
'
Me.MenuOver.Index = 4
Me.MenuOver.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuAuteur, Me.MenuProddate, Me.MenuItem18, Me.MenuVersion})
Me.MenuOver.Text = "&Over..."
'
'MenuAuteur
'
Me.MenuAuteur.Index = 0
Me.MenuAuteur.Text = "Over WBC..."
'
'MenuProddate
'
Me.MenuProddate.Index = 1
Me.MenuProddate.Text = "Produktiedatum"
'
'MenuItem18
'
Me.MenuItem18.Index = 2
Me.MenuItem18.Text = "-"
'
'MenuVersion
'
Me.MenuVersion.Index = 3
Me.MenuVersion.Text = "Versie"
'
'ButAcceptBron
'
Me.ButAcceptBron.Location = New System.Drawing.Point(440, 192)
Me.ButAcceptBron.Name = "ButAcceptBron"
Me.ButAcceptBron.Size = New System.Drawing.Size(64, 24)
Me.ButAcceptBron.TabIndex = 27
Me.ButAcceptBron.Text = "Ok"
Me.ButAcceptBron.Visible = False
'
'PBlogo2
'
Me.PBlogo2.Image = CType(resources.GetObject("PBlogo2.Image"), System.Drawing.Image)
Me.PBlogo2.Location = New System.Drawing.Point(672, 56)
Me.PBlogo2.Name = "PBlogo2"
Me.PBlogo2.Size = New System.Drawing.Size(160, 32)
Me.PBlogo2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PBlogo2.TabIndex = 28
Me.PBlogo2.TabStop = False
'
'ButBladeren1
'
Me.ButBladeren1.Location = New System.Drawing.Point(720, 136)
Me.ButBladeren1.Name = "ButBladeren1"
Me.ButBladeren1.Size = New System.Drawing.Size(24, 24)
Me.ButBladeren1.TabIndex = 29
Me.ButBladeren1.Text = "..."
Me.ButBladeren1.Visible = False
'
'ButBladeren2
'
Me.ButBladeren2.Location = New System.Drawing.Point(720, 272)
Me.ButBladeren2.Name = "ButBladeren2"
Me.ButBladeren2.Size = New System.Drawing.Size(24, 24)
Me.ButBladeren2.TabIndex = 30
Me.ButBladeren2.Text = "..."
Me.ButBladeren2.Visible = False
'
'Lblresultaat
'
Me.Lblresultaat.Location = New System.Drawing.Point(64, 424)
Me.Lblresultaat.Name = "Lblresultaat"
Me.Lblresultaat.Size = New System.Drawing.Size(264, 80)
Me.Lblresultaat.TabIndex = 31
Me.Lblresultaat.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'FrmMain
'
Me.AutoScaleBaseSize = New System.Drawing.Size(7, 16)
Me.BackColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(192, Byte), CType(255, Byte))
Me.ClientSize = New System.Drawing.Size(848, 617)
Me.Controls.Add(Me.Lblresultaat)
Me.Controls.Add(Me.ButBladeren2)
Me.Controls.Add(Me.ButBladeren1)
Me.Controls.Add(Me.PBlogo2)
Me.Controls.Add(Me.ButAcceptBron)
Me.Controls.Add(Me.ButConv)
Me.Controls.Add(Me.tbDoelbest)
Me.Controls.Add(Me.LblDoelbest)
Me.Controls.Add(Me.tbBronbest)
Me.Controls.Add(Me.LblBronbest)
Me.Controls.Add(Me.LblResult)
Me.Controls.Add(Me.RbutConvall)
Me.Controls.Add(Me.LblConvKeuze)
Me.Controls.Add(Me.RbutConv1)
Me.Controls.Add(Me.PbLogo1)
Me.Controls.Add(Me.LblCopyright)
Me.Controls.Add(Me.ProgressBar1)
Me.Controls.Add(Me.progress)
Me.Font = New System.Drawing.Font("Arial Black", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.Menu = Me.Hoofdmenu
Me.Name = "FrmMain"
Me.Text = "Wolf Bestands Converter"
Me.progress.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub MenuNieuw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuNieuw.Click
' Bij het kiezen van "Nieuw Bestand" in het menu, wordt alles opgekomen items weer verborgen of geblokkeerd
Me.LblResult.Text = ""
Me.RbutConv1.Checked = False
Me.RbutConvall.Checked = False
Me.LblBronbest.Visible = False
Me.tbBronbest.Visible = False
Me.ButAcceptBron.Visible = False
Me.LblDoelbest.Visible = False
Me.tbDoelbest.Visible = False
Me.RbutConv1.Enabled = True
Me.RbutConvall.Enabled = True
Me.ButBladeren1.Visible = False
Me.ButBladeren2.Visible = False
Me.tbBronbest.Enabled = True
Me.ButConv.Enabled = False
End Sub
Private Sub MenuAfsluiten_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuAfsluiten.Click
'afsluiten van het programma bij kiezen afsluiten in het menu
End
End Sub
Private Sub MenuVersion_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuVersion.Click
'Tonen van een popup schermpje met het versie nummer
MsgBox("Versie 1.0.0", MsgBoxStyle.Information)
End Sub
Private Sub MenuProddate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuProddate.Click
'Tonen van een pop-up schermpje met de datum van uitbrenging
MsgBox("Deze versie is uitgebracht op" & (Chr(13)) & (Chr(13)) & "30 April 2005 om 19.40 uur.", MsgBoxStyle.Information)
End Sub
Private Sub MenuAuteur_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuAuteur.Click
' Bij de menukeuze van auteur wordt er een nieuw scherm getoond "frmAbout".
Dim frm As New frmAbout
frm.ShowDialog(Me)
frm.Dispose()
End Sub
Private Sub MenuHelp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuHelp.Click
' Bij de menukeuze van Help wordt er een nieuw scherm getoond "frmHelp".
Dim frm As New FrmHelp
frm.ShowDialog(Me)
frm.Dispose()
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RbutConv1.CheckedChanged
'Als de eerste optie wordt geselecteerd wordt nieuwe regel getoond en de tekst ingevuld
Me.LblBronbest.Text = "Geef het bronbestand op : "
Me.LblDoelbest.Text = "Geef het doelbestand op : "
Me.tbBronbest.Text = "<Bronbestand>"
Me.tbDoelbest.Text = "<Doelbestand>"
Me.LblBronbest.Visible = True
Me.tbBronbest.Visible = True
Me.ButBladeren1.Visible = True
Me.ButAcceptBron.Visible = False
Me.RbutConvall.Enabled = False
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RbutConvall.CheckedChanged
'Als de tweede optie wordt geselecteerd word de nieuwe regel getoond en de tekst aangepast
Me.LblBronbest.Text = "Geef de brondirectory op : "
Me.LblDoelbest.Text = "Geef de doeldirectory op : "
Me.tbBronbest.Text = "<Brondirectory>"
Me.tbDoelbest.Text = "<Doeldirectory>"
Me.LblBronbest.Visible = True
Me.tbBronbest.Visible = True
Me.ButBladeren1.Visible = True
Me.ButAcceptBron.Visible = False
Me.RbutConv1.Enabled = False
End Sub
Private Sub ButAcceptBron_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButAcceptBron.Click
' Na het drukken op OK wordt het veld voor het doel pas weergegeven.
Me.LblDoelbest.Visible = True
If RbutConv1.Checked = True Then
Me.tbDoelbest.Text = tbBronbest.Text & ".wlk"
Else
Me.tbDoelbest.Text = tbBronbest.Text
End If
Me.tbDoelbest.Visible = True
Me.ButBladeren2.Visible = True
Me.tbBronbest.Enabled = False
Me.ButConv.Enabled = True
End Sub
Private Sub tbBronbest_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbBronbest.TextChanged
' Zodra de tekst in de bron verandert verschijnt de ok button om verder te gaan.
Me.ButAcceptBron.Visible = True
End Sub
Private Sub ButConv_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButConv.Click
Me.LblResult.Text = "Resultaat:"
Me.tbDoelbest.Enabled = False
' Create an instance of StreamReader to read from a file.
Dim sr As StreamReader = New StreamReader(tbBronbest.Text)
Dim line As String
' Read and write the lines from the source to the target until the end
' of the file is reached.
' Create an instance of StreamWriter to write text to a file.
Dim sw As StreamWriter = New StreamWriter(tbDoelbest.Text)
' Add some text to the file.
sw.Write("This is the ")
sw.WriteLine("header for the file.")
sw.WriteLine("-------------------")
' Arbitrary objects can also be written to the file.
sw.Write("The date is: ")
sw.WriteLine(DateTime.Now)
Do
line = sr.ReadLine()
sw.WriteLine(line)
Loop Until line Is Nothing
sr.Close()
sw.Close()
End Sub
End Class
The user must give a source file or directory (if the choose to convert more than one file)and a target directory and next to the textbox I made a button for browsing, wich has to browse files if they select one file convert, or browse directories if they selected complete directory convert. Now the most things work except for that browse buttons. How can i make that button work ?? do i need to imports things or what. I have the code for the main form inserted under this. I tried a lot of things from samples, but i still can't get it working.
existing code:
Imports System
Imports System.IO
Public Class FrmMain
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar
Friend WithEvents progress As System.Windows.Forms.GroupBox
Friend WithEvents Hoofdmenu As System.Windows.Forms.MainMenu
Friend WithEvents MenuBestand As System.Windows.Forms.MenuItem
Friend WithEvents MenuNieuw As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Friend WithEvents MenuAfsluiten As System.Windows.Forms.MenuItem
Friend WithEvents MenuHelp As System.Windows.Forms.MenuItem
Friend WithEvents MenuOver As System.Windows.Forms.MenuItem
Friend WithEvents MenuAuteur As System.Windows.Forms.MenuItem
Friend WithEvents MenuProddate As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem18 As System.Windows.Forms.MenuItem
Friend WithEvents MenuVersion As System.Windows.Forms.MenuItem
Friend WithEvents ButConv As System.Windows.Forms.Button
Friend WithEvents tbDoelbest As System.Windows.Forms.TextBox
Friend WithEvents LblDoelbest As System.Windows.Forms.Label
Friend WithEvents tbBronbest As System.Windows.Forms.TextBox
Friend WithEvents LblBronbest As System.Windows.Forms.Label
Friend WithEvents LblResult As System.Windows.Forms.Label
Friend WithEvents RbutConvall As System.Windows.Forms.RadioButton
Friend WithEvents LblConvKeuze As System.Windows.Forms.Label
Friend WithEvents RbutConv1 As System.Windows.Forms.RadioButton
Friend WithEvents LblCopyright As System.Windows.Forms.Label
Friend WithEvents LblProgress As System.Windows.Forms.Label
Friend WithEvents MenuItemleeg1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItemleeg2 As System.Windows.Forms.MenuItem
Friend WithEvents ButAcceptBron As System.Windows.Forms.Button
Friend WithEvents PbLogo1 As System.Windows.Forms.PictureBox
Friend WithEvents PBlogo2 As System.Windows.Forms.PictureBox
Friend WithEvents ButBladeren1 As System.Windows.Forms.Button
Friend WithEvents ButBladeren2 As System.Windows.Forms.Button
Friend WithEvents FolderBrowserDialog1 As System.Windows.Forms.FolderBrowserDialog
Friend WithEvents Lblresultaat As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FrmMain))
Me.ButConv = New System.Windows.Forms.Button
Me.tbDoelbest = New System.Windows.Forms.TextBox
Me.LblDoelbest = New System.Windows.Forms.Label
Me.tbBronbest = New System.Windows.Forms.TextBox
Me.LblBronbest = New System.Windows.Forms.Label
Me.LblResult = New System.Windows.Forms.Label
Me.RbutConvall = New System.Windows.Forms.RadioButton
Me.LblConvKeuze = New System.Windows.Forms.Label
Me.RbutConv1 = New System.Windows.Forms.RadioButton
Me.PbLogo1 = New System.Windows.Forms.PictureBox
Me.LblCopyright = New System.Windows.Forms.Label
Me.ProgressBar1 = New System.Windows.Forms.ProgressBar
Me.progress = New System.Windows.Forms.GroupBox
Me.LblProgress = New System.Windows.Forms.Label
Me.Hoofdmenu = New System.Windows.Forms.MainMenu
Me.MenuBestand = New System.Windows.Forms.MenuItem
Me.MenuNieuw = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
Me.MenuAfsluiten = New System.Windows.Forms.MenuItem
Me.MenuItemleeg1 = New System.Windows.Forms.MenuItem
Me.MenuHelp = New System.Windows.Forms.MenuItem
Me.MenuItemleeg2 = New System.Windows.Forms.MenuItem
Me.MenuOver = New System.Windows.Forms.MenuItem
Me.MenuAuteur = New System.Windows.Forms.MenuItem
Me.MenuProddate = New System.Windows.Forms.MenuItem
Me.MenuItem18 = New System.Windows.Forms.MenuItem
Me.MenuVersion = New System.Windows.Forms.MenuItem
Me.ButAcceptBron = New System.Windows.Forms.Button
Me.PBlogo2 = New System.Windows.Forms.PictureBox
Me.ButBladeren1 = New System.Windows.Forms.Button
Me.ButBladeren2 = New System.Windows.Forms.Button
Me.FolderBrowserDialog1 = New System.Windows.Forms.FolderBrowserDialog
Me.Lblresultaat = New System.Windows.Forms.Label
Me.progress.SuspendLayout()
Me.SuspendLayout()
'
'ButConv
'
Me.ButConv.BackColor = System.Drawing.Color.Lime
Me.ButConv.Enabled = False
Me.ButConv.Font = New System.Drawing.Font("Arial Black", 12.0!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ButConv.Location = New System.Drawing.Point(568, 336)
Me.ButConv.Name = "ButConv"
Me.ButConv.Size = New System.Drawing.Size(152, 48)
Me.ButConv.TabIndex = 26
Me.ButConv.Text = "Converteer !"
'
'tbDoelbest
'
Me.tbDoelbest.Location = New System.Drawing.Point(248, 272)
Me.tbDoelbest.Name = "tbDoelbest"
Me.tbDoelbest.Size = New System.Drawing.Size(472, 23)
Me.tbDoelbest.TabIndex = 25
Me.tbDoelbest.Text = ""
Me.tbDoelbest.Visible = False
'
'LblDoelbest
'
Me.LblDoelbest.Location = New System.Drawing.Point(48, 272)
Me.LblDoelbest.Name = "LblDoelbest"
Me.LblDoelbest.Size = New System.Drawing.Size(176, 24)
Me.LblDoelbest.TabIndex = 24
Me.LblDoelbest.Text = "Geef het doelbestand op : "
Me.LblDoelbest.Visible = False
'
'tbBronbest
'
Me.tbBronbest.Location = New System.Drawing.Point(248, 136)
Me.tbBronbest.Name = "tbBronbest"
Me.tbBronbest.Size = New System.Drawing.Size(472, 23)
Me.tbBronbest.TabIndex = 23
Me.tbBronbest.Text = ""
Me.tbBronbest.Visible = False
'
'LblBronbest
'
Me.LblBronbest.Location = New System.Drawing.Point(48, 136)
Me.LblBronbest.Name = "LblBronbest"
Me.LblBronbest.Size = New System.Drawing.Size(176, 24)
Me.LblBronbest.TabIndex = 22
Me.LblBronbest.Text = "Geef het bronbestand op : "
Me.LblBronbest.Visible = False
'
'LblResult
'
Me.LblResult.Location = New System.Drawing.Point(48, 368)
Me.LblResult.Name = "LblResult"
Me.LblResult.Size = New System.Drawing.Size(304, 152)
Me.LblResult.TabIndex = 21
'
'RbutConvall
'
Me.RbutConvall.Location = New System.Drawing.Point(40, 72)
Me.RbutConvall.Name = "RbutConvall"
Me.RbutConvall.Size = New System.Drawing.Size(120, 24)
Me.RbutConvall.TabIndex = 20
Me.RbutConvall.Text = "Alle Bestanden"
'
'LblConvKeuze
'
Me.LblConvKeuze.Location = New System.Drawing.Point(40, 24)
Me.LblConvKeuze.Name = "LblConvKeuze"
Me.LblConvKeuze.Size = New System.Drawing.Size(168, 16)
Me.LblConvKeuze.TabIndex = 19
Me.LblConvKeuze.Text = "Wat wilt u converteren ?"
'
'RbutConv1
'
Me.RbutConv1.Location = New System.Drawing.Point(40, 48)
Me.RbutConv1.Name = "RbutConv1"
Me.RbutConv1.Size = New System.Drawing.Size(120, 24)
Me.RbutConv1.TabIndex = 18
Me.RbutConv1.Text = "Eén Bestand"
'
'PbLogo1
'
Me.PbLogo1.Image = CType(resources.GetObject("PbLogo1.Image"), System.Drawing.Image)
Me.PbLogo1.Location = New System.Drawing.Point(672, 8)
Me.PbLogo1.Name = "PbLogo1"
Me.PbLogo1.Size = New System.Drawing.Size(160, 48)
Me.PbLogo1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PbLogo1.TabIndex = 17
Me.PbLogo1.TabStop = False
'
'LblCopyright
'
Me.LblCopyright.Location = New System.Drawing.Point(8, 592)
Me.LblCopyright.Name = "LblCopyright"
Me.LblCopyright.Size = New System.Drawing.Size(152, 16)
Me.LblCopyright.TabIndex = 15
Me.LblCopyright.Text = "©2005 by M.J. Maas"
'
'ProgressBar1
'
Me.ProgressBar1.Location = New System.Drawing.Point(496, 464)
Me.ProgressBar1.Name = "ProgressBar1"
Me.ProgressBar1.Size = New System.Drawing.Size(208, 16)
Me.ProgressBar1.TabIndex = 14
'
'progress
'
Me.progress.AccessibleRole = System.Windows.Forms.AccessibleRole.ProgressBar
Me.progress.Controls.Add(Me.LblProgress)
Me.progress.Location = New System.Drawing.Point(480, 424)
Me.progress.Name = "progress"
Me.progress.Size = New System.Drawing.Size(240, 72)
Me.progress.TabIndex = 16
Me.progress.TabStop = False
'
'LblProgress
'
Me.LblProgress.Location = New System.Drawing.Point(72, 24)
Me.LblProgress.Name = "LblProgress"
Me.LblProgress.Size = New System.Drawing.Size(88, 24)
Me.LblProgress.TabIndex = 0
Me.LblProgress.Text = "Progress Bar"
'
'Hoofdmenu
'
Me.Hoofdmenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuBestand, Me.MenuItemleeg1, Me.MenuHelp, Me.MenuItemleeg2, Me.MenuOver})
'
'MenuBestand
'
Me.MenuBestand.Index = 0
Me.MenuBestand.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuNieuw, Me.MenuItem3, Me.MenuAfsluiten})
Me.MenuBestand.Text = "&Bestand"
'
'MenuNieuw
'
Me.MenuNieuw.Index = 0
Me.MenuNieuw.Text = "&Nieuw Conversie"
'
'MenuItem3
'
Me.MenuItem3.Index = 1
Me.MenuItem3.Text = "-"
'
'MenuAfsluiten
'
Me.MenuAfsluiten.Index = 2
Me.MenuAfsluiten.Text = "&Afsluiten"
'
'MenuItemleeg1
'
Me.MenuItemleeg1.Enabled = False
Me.MenuItemleeg1.Index = 1
Me.MenuItemleeg1.Text = ""
'
'MenuHelp
'
Me.MenuHelp.Index = 2
Me.MenuHelp.Text = "&Help"
'
'MenuItemleeg2
'
Me.MenuItemleeg2.Enabled = False
Me.MenuItemleeg2.Index = 3
Me.MenuItemleeg2.Text = ""
'
'MenuOver
'
Me.MenuOver.Index = 4
Me.MenuOver.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuAuteur, Me.MenuProddate, Me.MenuItem18, Me.MenuVersion})
Me.MenuOver.Text = "&Over..."
'
'MenuAuteur
'
Me.MenuAuteur.Index = 0
Me.MenuAuteur.Text = "Over WBC..."
'
'MenuProddate
'
Me.MenuProddate.Index = 1
Me.MenuProddate.Text = "Produktiedatum"
'
'MenuItem18
'
Me.MenuItem18.Index = 2
Me.MenuItem18.Text = "-"
'
'MenuVersion
'
Me.MenuVersion.Index = 3
Me.MenuVersion.Text = "Versie"
'
'ButAcceptBron
'
Me.ButAcceptBron.Location = New System.Drawing.Point(440, 192)
Me.ButAcceptBron.Name = "ButAcceptBron"
Me.ButAcceptBron.Size = New System.Drawing.Size(64, 24)
Me.ButAcceptBron.TabIndex = 27
Me.ButAcceptBron.Text = "Ok"
Me.ButAcceptBron.Visible = False
'
'PBlogo2
'
Me.PBlogo2.Image = CType(resources.GetObject("PBlogo2.Image"), System.Drawing.Image)
Me.PBlogo2.Location = New System.Drawing.Point(672, 56)
Me.PBlogo2.Name = "PBlogo2"
Me.PBlogo2.Size = New System.Drawing.Size(160, 32)
Me.PBlogo2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PBlogo2.TabIndex = 28
Me.PBlogo2.TabStop = False
'
'ButBladeren1
'
Me.ButBladeren1.Location = New System.Drawing.Point(720, 136)
Me.ButBladeren1.Name = "ButBladeren1"
Me.ButBladeren1.Size = New System.Drawing.Size(24, 24)
Me.ButBladeren1.TabIndex = 29
Me.ButBladeren1.Text = "..."
Me.ButBladeren1.Visible = False
'
'ButBladeren2
'
Me.ButBladeren2.Location = New System.Drawing.Point(720, 272)
Me.ButBladeren2.Name = "ButBladeren2"
Me.ButBladeren2.Size = New System.Drawing.Size(24, 24)
Me.ButBladeren2.TabIndex = 30
Me.ButBladeren2.Text = "..."
Me.ButBladeren2.Visible = False
'
'Lblresultaat
'
Me.Lblresultaat.Location = New System.Drawing.Point(64, 424)
Me.Lblresultaat.Name = "Lblresultaat"
Me.Lblresultaat.Size = New System.Drawing.Size(264, 80)
Me.Lblresultaat.TabIndex = 31
Me.Lblresultaat.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'FrmMain
'
Me.AutoScaleBaseSize = New System.Drawing.Size(7, 16)
Me.BackColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(192, Byte), CType(255, Byte))
Me.ClientSize = New System.Drawing.Size(848, 617)
Me.Controls.Add(Me.Lblresultaat)
Me.Controls.Add(Me.ButBladeren2)
Me.Controls.Add(Me.ButBladeren1)
Me.Controls.Add(Me.PBlogo2)
Me.Controls.Add(Me.ButAcceptBron)
Me.Controls.Add(Me.ButConv)
Me.Controls.Add(Me.tbDoelbest)
Me.Controls.Add(Me.LblDoelbest)
Me.Controls.Add(Me.tbBronbest)
Me.Controls.Add(Me.LblBronbest)
Me.Controls.Add(Me.LblResult)
Me.Controls.Add(Me.RbutConvall)
Me.Controls.Add(Me.LblConvKeuze)
Me.Controls.Add(Me.RbutConv1)
Me.Controls.Add(Me.PbLogo1)
Me.Controls.Add(Me.LblCopyright)
Me.Controls.Add(Me.ProgressBar1)
Me.Controls.Add(Me.progress)
Me.Font = New System.Drawing.Font("Arial Black", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.Menu = Me.Hoofdmenu
Me.Name = "FrmMain"
Me.Text = "Wolf Bestands Converter"
Me.progress.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub MenuNieuw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuNieuw.Click
' Bij het kiezen van "Nieuw Bestand" in het menu, wordt alles opgekomen items weer verborgen of geblokkeerd
Me.LblResult.Text = ""
Me.RbutConv1.Checked = False
Me.RbutConvall.Checked = False
Me.LblBronbest.Visible = False
Me.tbBronbest.Visible = False
Me.ButAcceptBron.Visible = False
Me.LblDoelbest.Visible = False
Me.tbDoelbest.Visible = False
Me.RbutConv1.Enabled = True
Me.RbutConvall.Enabled = True
Me.ButBladeren1.Visible = False
Me.ButBladeren2.Visible = False
Me.tbBronbest.Enabled = True
Me.ButConv.Enabled = False
End Sub
Private Sub MenuAfsluiten_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuAfsluiten.Click
'afsluiten van het programma bij kiezen afsluiten in het menu
End
End Sub
Private Sub MenuVersion_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuVersion.Click
'Tonen van een popup schermpje met het versie nummer
MsgBox("Versie 1.0.0", MsgBoxStyle.Information)
End Sub
Private Sub MenuProddate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuProddate.Click
'Tonen van een pop-up schermpje met de datum van uitbrenging
MsgBox("Deze versie is uitgebracht op" & (Chr(13)) & (Chr(13)) & "30 April 2005 om 19.40 uur.", MsgBoxStyle.Information)
End Sub
Private Sub MenuAuteur_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuAuteur.Click
' Bij de menukeuze van auteur wordt er een nieuw scherm getoond "frmAbout".
Dim frm As New frmAbout
frm.ShowDialog(Me)
frm.Dispose()
End Sub
Private Sub MenuHelp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuHelp.Click
' Bij de menukeuze van Help wordt er een nieuw scherm getoond "frmHelp".
Dim frm As New FrmHelp
frm.ShowDialog(Me)
frm.Dispose()
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RbutConv1.CheckedChanged
'Als de eerste optie wordt geselecteerd wordt nieuwe regel getoond en de tekst ingevuld
Me.LblBronbest.Text = "Geef het bronbestand op : "
Me.LblDoelbest.Text = "Geef het doelbestand op : "
Me.tbBronbest.Text = "<Bronbestand>"
Me.tbDoelbest.Text = "<Doelbestand>"
Me.LblBronbest.Visible = True
Me.tbBronbest.Visible = True
Me.ButBladeren1.Visible = True
Me.ButAcceptBron.Visible = False
Me.RbutConvall.Enabled = False
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RbutConvall.CheckedChanged
'Als de tweede optie wordt geselecteerd word de nieuwe regel getoond en de tekst aangepast
Me.LblBronbest.Text = "Geef de brondirectory op : "
Me.LblDoelbest.Text = "Geef de doeldirectory op : "
Me.tbBronbest.Text = "<Brondirectory>"
Me.tbDoelbest.Text = "<Doeldirectory>"
Me.LblBronbest.Visible = True
Me.tbBronbest.Visible = True
Me.ButBladeren1.Visible = True
Me.ButAcceptBron.Visible = False
Me.RbutConv1.Enabled = False
End Sub
Private Sub ButAcceptBron_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButAcceptBron.Click
' Na het drukken op OK wordt het veld voor het doel pas weergegeven.
Me.LblDoelbest.Visible = True
If RbutConv1.Checked = True Then
Me.tbDoelbest.Text = tbBronbest.Text & ".wlk"
Else
Me.tbDoelbest.Text = tbBronbest.Text
End If
Me.tbDoelbest.Visible = True
Me.ButBladeren2.Visible = True
Me.tbBronbest.Enabled = False
Me.ButConv.Enabled = True
End Sub
Private Sub tbBronbest_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbBronbest.TextChanged
' Zodra de tekst in de bron verandert verschijnt de ok button om verder te gaan.
Me.ButAcceptBron.Visible = True
End Sub
Private Sub ButConv_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButConv.Click
Me.LblResult.Text = "Resultaat:"
Me.tbDoelbest.Enabled = False
' Create an instance of StreamReader to read from a file.
Dim sr As StreamReader = New StreamReader(tbBronbest.Text)
Dim line As String
' Read and write the lines from the source to the target until the end
' of the file is reached.
' Create an instance of StreamWriter to write text to a file.
Dim sw As StreamWriter = New StreamWriter(tbDoelbest.Text)
' Add some text to the file.
sw.Write("This is the ")
sw.WriteLine("header for the file.")
sw.WriteLine("-------------------")
' Arbitrary objects can also be written to the file.
sw.Write("The date is: ")
sw.WriteLine(DateTime.Now)
Do
line = sr.ReadLine()
sw.WriteLine(line)
Loop Until line Is Nothing
sr.Close()
sw.Close()
End Sub
End Class