-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmOptions.frm
128 lines (121 loc) · 3.07 KB
/
frmOptions.frm
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
VERSION 5.00
Begin VB.Form frmOptions
BorderStyle = 3 'Fixed Dialog
Caption = "VBCodeLibrary Options"
ClientHeight = 2355
ClientLeft = 45
ClientTop = 330
ClientWidth = 4710
BeginProperty Font
Name = "Verdana"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmOptions.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2355
ScaleWidth = 4710
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "&Cancel"
Height = 390
Left = 3585
TabIndex = 2
Top = 1890
Width = 1050
End
Begin VB.CommandButton cmdOK
Caption = "&OK"
Default = -1 'True
Height = 390
Left = 2445
TabIndex = 1
Top = 1890
Width = 1050
End
Begin VB.ListBox lstOptions
Height = 1410
Left = 45
Style = 1 'Checkbox
TabIndex = 0
Top = 390
Width = 4605
End
Begin VB.Label lblCaption
BackStyle = 0 'Transparent
Caption = "Available Options :"
Height = 255
Left = 90
TabIndex = 3
Top = 90
Width = 3465
End
End
Attribute VB_Name = "frmOptions"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'
' Options Form
'
' http://www.codeguru.com/vb
'
'
' Chris Eastwood Feb. 1999
'
Private moSettings As CSettings ' Settings object
Public Sub Initialise(oSettings As CSettings)
'
' Entry point
' - Record Settings object
'
Set moSettings = oSettings
'
' populate list box with available options
'
With lstOptions
.Clear
.AddItem "Backup Database On Startup"
.Selected(.NewIndex) = oSettings.BackupDatabaseAtStart
.AddItem "Compact Database On Exit"
.Selected(.NewIndex) = oSettings.CompactDatabaseOnExit
.AddItem "Save Form Layout on Exit"
.Selected(.NewIndex) = oSettings.SaveFormLayout
.ListIndex = 0
End With
End Sub
Private Sub cmdCancel_Click()
'
' User Cancelled
'
Set moSettings = Nothing
'
' Hide the form
'
Me.Hide
End Sub
Private Sub cmdOk_Click()
'
' Change Settings Options
'
With lstOptions
moSettings.BackupDatabaseAtStart = .Selected(0)
moSettings.CompactDatabaseOnExit = .Selected(1)
moSettings.SaveFormLayout = .Selected(2)
End With
Set moSettings = Nothing
'
' Hide the form
'
Me.Hide
End Sub