-
Notifications
You must be signed in to change notification settings - Fork 36
/
frmBonusPopout.vb
77 lines (55 loc) · 2.99 KB
/
frmBonusPopout.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Public Class frmBonusPopout
Private ColumnClicked As Integer
Private ColumnSortType As SortOrder
Public Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
' Set up all the sizes
Me.Height = StructureBonusPopoutViewerSettings.FormHeight
Me.Width = StructureBonusPopoutViewerSettings.FormWidth
lstUpwellStructureBonuses.Columns(0).Width = StructureBonusPopoutViewerSettings.BonusAppliesColumnWidth
lstUpwellStructureBonuses.Columns(1).Width = StructureBonusPopoutViewerSettings.ActivityColumnWidth
lstUpwellStructureBonuses.Columns(2).Width = StructureBonusPopoutViewerSettings.BonusesColumnWidth
lstUpwellStructureBonuses.Columns(3).Width = StructureBonusPopoutViewerSettings.BonusSourceColumnWidth
End Sub
Private Sub frmBonusPopout_Layout(sender As Object, e As LayoutEventArgs) Handles Me.Layout
' Resize the grid
lstUpwellStructureBonuses.Height = Me.Height - 94
lstUpwellStructureBonuses.Width = Me.Width - 38
' Move the buttons
btnSaveSettings.Left = CInt(Me.Width / 2) - btnSaveSettings.Width - 10 ' middle of form minus half spacing and button width
btnSaveSettings.Top = Me.Height - 73
btnClose.Left = CInt(Me.Width / 2) + 10 ' middle of form plus half spacing
btnClose.Top = Me.Height - 73
Application.DoEvents()
End Sub
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
Me.Hide()
Me.Dispose()
End Sub
Private Sub btnSaveSettings_Click(sender As Object, e As EventArgs) Handles btnSaveSettings.Click
Dim TempSettings As StructureBonusPopoutSettings = Nothing
' Save the height, width, and column sizes for later
Try
With TempSettings
.FormHeight = Me.Height
.FormWidth = Me.Width
.BonusAppliesColumnWidth = lstUpwellStructureBonuses.Columns(0).Width
.ActivityColumnWidth = lstUpwellStructureBonuses.Columns(1).Width
.BonusesColumnWidth = lstUpwellStructureBonuses.Columns(2).Width
.BonusSourceColumnWidth = lstUpwellStructureBonuses.Columns(3).Width
End With
AllSettings.SaveStructureBonusPopoutViewerSettings(TempSettings)
StructureBonusPopoutViewerSettings = TempSettings
Call MsgBox("Settings Saved", vbInformation, Application.ProductName)
Catch ex As Exception
Call MsgBox("Settings failed to save: " & ex.Message, vbExclamation, Application.ProductName)
End Try
Application.DoEvents()
End Sub
Private Sub lstUpwellStructureBonuses_ColumnClick(sender As Object, e As ColumnClickEventArgs) Handles lstUpwellStructureBonuses.ColumnClick
Call ListViewColumnSorter(e.Column, CType(lstUpwellStructureBonuses, ListView), ColumnClicked, ColumnSortType)
End Sub
End Class