add button for clearing logs

This commit is contained in:
Jonathan Jenne 2019-07-04 16:10:22 +02:00
parent 0148ba84c5
commit 0ab3acddb4
2 changed files with 21 additions and 0 deletions

View File

@ -45,6 +45,7 @@ Partial Class Form1
Me.Button4 = New System.Windows.Forms.Button() Me.Button4 = New System.Windows.Forms.Button()
Me.Button6 = New System.Windows.Forms.Button() Me.Button6 = New System.Windows.Forms.Button()
Me.ListBox1 = New System.Windows.Forms.ListBox() Me.ListBox1 = New System.Windows.Forms.ListBox()
Me.Button7 = New System.Windows.Forms.Button()
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout() Me.SuspendLayout()
@ -247,11 +248,21 @@ Partial Class Form1
Me.ListBox1.Size = New System.Drawing.Size(355, 303) Me.ListBox1.Size = New System.Drawing.Size(355, 303)
Me.ListBox1.TabIndex = 24 Me.ListBox1.TabIndex = 24
' '
'Button7
'
Me.Button7.Location = New System.Drawing.Point(764, 143)
Me.Button7.Name = "Button7"
Me.Button7.Size = New System.Drawing.Size(75, 23)
Me.Button7.TabIndex = 25
Me.Button7.Text = "Clear Logs"
Me.Button7.UseVisualStyleBackColor = True
'
'Form1 'Form1
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1050, 487) Me.ClientSize = New System.Drawing.Size(1050, 487)
Me.Controls.Add(Me.Button7)
Me.Controls.Add(Me.ListBox1) Me.Controls.Add(Me.ListBox1)
Me.Controls.Add(Me.Button6) Me.Controls.Add(Me.Button6)
Me.Controls.Add(Me.Button4) Me.Controls.Add(Me.Button4)
@ -307,4 +318,5 @@ Partial Class Form1
Friend WithEvents Button4 As Button Friend WithEvents Button4 As Button
Friend WithEvents Button6 As Button Friend WithEvents Button6 As Button
Friend WithEvents ListBox1 As ListBox Friend WithEvents ListBox1 As ListBox
Friend WithEvents Button7 As Button
End Class End Class

View File

@ -178,4 +178,13 @@ Public Class Form1
ListBox1.Items.Add(oLog) ListBox1.Items.Add(oLog)
Next Next
End Sub End Sub
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
MyLogger.ClearLogs()
ListBox1.Items.Clear()
For Each oLog In MyLogger.Logs
ListBox1.Items.Add(oLog)
Next
End Sub
End Class End Class