-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
HistoryDialog.vb
32 lines (27 loc) · 1.26 KB
/
HistoryDialog.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Public Class HistoryDialog
Public Property Rows() As Integer
Public Property Columns() As Integer
Public Property Depth() As Integer
Private Sub HistoryListView_KeyUp(sender As Object, e As KeyEventArgs) Handles HistoryListView.KeyUp
If e.Control AndAlso e.KeyCode = Keys.C Then
Dim tag = $"""Checkers Solitaire"",""{Application.ProductVersion}"",""{Rows}"",""{Columns}"",""{Depth}""{vbCrLf}"
Dim csv = $"{tag}""Move #"",""Start Row"",""Start Column"",""Destination Row"",""Destination Column""{vbCrLf}"
For Each item As ListViewItem In HistoryListView.Items
csv &= $"{item.SubItems(0).Text},{item.SubItems(1).Text},{item.SubItems(2).Text},{item.SubItems(4).Text},{item.SubItems(5).Text}{vbCrLf}"
Next
Clipboard.SetDataObject(csv, True)
ElseIf e.Control AndAlso e.KeyCode = Keys.A Then
For Each item As ListViewItem In HistoryListView.Items
item.Selected = True
Next
End If
End Sub
Private Sub ViewHistory_Activated(sender As Object, e As EventArgs) Handles MyBase.Activated
If HistoryListView.CanFocus Then
HistoryListView.Focus()
End If
End Sub
Private Sub ViewHistory_GotFocus(sender As Object, e As EventArgs) Handles MyBase.GotFocus
HistoryListView.Focus()
End Sub
End Class