Dit is de hele code:
[CPP]Public Class Form1
Private ResizeB As Boolean = False
Private HeightThread As New System.Threading.Thread(AddressOf heightcontrol)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fbd As New FolderBrowserDialog
fbd.Description = "Kies de folder met de bestanden."
fbd.ShowNewFolderButton = False
Dim dr As DialogResult = fbd.ShowDialog
If dr = Windows.Forms.DialogResult.Abort Or dr = Windows.Forms.DialogResult.Cancel Or dr = Windows.Forms.DialogResult.No Or dr = Windows.Forms.DialogResult.None Or dr = Windows.Forms.DialogResult.Ignore Then
Exit Sub
ElseIf dr = Windows.Forms.DialogResult.Retry Then
Button1.PerformClick()
Exit Sub
End If
If My.Computer.FileSystem.DirectoryExists(fbd.SelectedPath) Then
TextBox1.Text = fbd.SelectedPath
Else
MsgBox("Deze folder bestaat niet. Kies een andere.")
Button1.PerformClick()
Exit Sub
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If Not My.Computer.FileSystem.DirectoryExists(TextBox1.Text) Then
MsgBox("De map bestaat niet. Kies een bestaande map.")
Button1.PerformClick()
Exit Sub
End If
If Not IsNumeric(TextBox4.Text) Then
MsgBox("Je moet wel een nummer invoeren bij het op te tellen getal.")
Exit Sub
End If
Dim MapInfo As New IO.DirectoryInfo(TextBox1.Text)
ProgressBar1.Maximum = MapInfo.GetFiles.Length
For Each File As IO.FileInfo In MapInfo.GetFiles
If File.Name.Substring(0, TextBox2.Text.Length) = TextBox2.Text And File.Name.Substring(File.Name.Length - TextBox3.Text.Length, TextBox3.Text.Length) = TextBox3.Text Then
Dim Nummer As Integer = CInt(File.Name.Remove(0, TextBox2.Text.Length).Remove(File.Name.Length - TextBox3.Text.Length - TextBox2.Text.Length, TextBox3.Text.Length))
Nummer += CInt(TextBox4.Text)
Dim NieuweNaam As String = TextBox2.Text & Nummer.ToString & TextBox3.Text
My.Computer.FileSystem.RenameFile(File.FullName, NieuweNaam)
End If
ProgressBar1.Value += 1
Next
MsgBox("Klaar!")
ProgressBar1.Value = 0
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
HeightThread.Abort()
Application.Exit()
End Sub
Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
HeightThread.Abort()
Application.Exit()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CheckForIllegalCrossThreadCalls = False
HeightThread.Start()
End Sub
Private Sub heightcontrol()
While True
Me.Height = 210
End While
End Sub
End Class
[/CPP]
En ook nog de designer omdat mijn naamgeving echt slecht is bij kleinere projecten (te lui

)

:
[CPP]<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.'
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
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.'
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Label1 = New System.Windows.Forms.Label
Me.Button1 = New System.Windows.Forms.Button
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.TextBox3 = New System.Windows.Forms.TextBox
Me.Button2 = New System.Windows.Forms.Button
Me.ProgressBar1 = New System.Windows.Forms.ProgressBar
Me.Button3 = New System.Windows.Forms.Button
Me.TextBox4 = New System.Windows.Forms.TextBox
Me.Label4 = New System.Windows.Forms.Label
Me.SuspendLayout()
''
'TextBox1'
''
Me.TextBox1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.TextBox1.Location = New System.Drawing.Point(46, 14)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(191, 20)
Me.TextBox1.TabIndex = 0
''
'Label1'
''
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(12, 17)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(28, 13)
Me.Label1.TabIndex = 7
Me.Label1.Text = "Map"
''
'Button1'
''
Me.Button1.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Button1.Location = New System.Drawing.Point(243, 12)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(75, 23)
Me.Button1.TabIndex = 1
Me.Button1.TabStop = False
Me.Button1.Text = "Bladeren..."
Me.Button1.UseVisualStyleBackColor = True
''
'Label2'
''
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(12, 44)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(87, 13)
Me.Label2.TabIndex = 8
Me.Label2.Text = "Voor het nummer"
''
'Label3'
''
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(12, 70)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(79, 13)
Me.Label3.TabIndex = 9
Me.Label3.Text = "Na het nummer"
''
'TextBox2'
''
Me.TextBox2.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.TextBox2.Location = New System.Drawing.Point(105, 41)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(213, 20)
Me.TextBox2.TabIndex = 2
''
'TextBox3'
''
Me.TextBox3.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.TextBox3.Location = New System.Drawing.Point(105, 67)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.Size = New System.Drawing.Size(213, 20)
Me.TextBox3.TabIndex = 3
''
'Button2'
''
Me.Button2.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Button2.Location = New System.Drawing.Point(243, 119)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(75, 23)
Me.Button2.TabIndex = 5
Me.Button2.Text = "Go!"
Me.Button2.UseVisualStyleBackColor = True
''
'ProgressBar1'
''
Me.ProgressBar1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.ProgressBar1.Location = New System.Drawing.Point(12, 148)
Me.ProgressBar1.Name = "ProgressBar1"
Me.ProgressBar1.Size = New System.Drawing.Size(306, 15)
Me.ProgressBar1.TabIndex = 11
''
'Button3'
''
Me.Button3.Location = New System.Drawing.Point(12, 119)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(75, 23)
Me.Button3.TabIndex = 6
Me.Button3.TabStop = False
Me.Button3.Text = "Sluiten"
Me.Button3.UseVisualStyleBackColor = True
''
'TextBox4'
''
Me.TextBox4.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.TextBox4.Location = New System.Drawing.Point(105, 93)
Me.TextBox4.Name = "TextBox4"
Me.TextBox4.Size = New System.Drawing.Size(213, 20)
Me.TextBox4.TabIndex = 4
''
'Label4'
''
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(12, 96)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(67, 13)
Me.Label4.TabIndex = 10
Me.Label4.Text = "Erbij optellen"
''
'Form1'
''
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(330, 172)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.TextBox4)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.ProgressBar1)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.TextBox3)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.TextBox1)
Me.Name = "Form1"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents Label4 As System.Windows.Forms.Label
End Class
[/CPP]
En als je het eerst wil bekijken voordat je het gebruikt, is dit de exe:
Bekijk bijlage Image Getallen Veranderen.zip
(Zit in een zip omdat je geen exe mag uploaden...)
Succes!
MartinJM