- The
design.
TestVB0 |
.....
File ..
Data
.
.
.
.
|
.
.
.
.
.
.
.
|
.
.
.
.
.
. |
 |
|
- The View
Code.
Private Sub
Form_Load()
Me.Left
= GetSetting(App.Title,
"Settings", "MainLeft",
1000)
Me.Top
= GetSetting(App.Title, "Settings",
"MainTop", 1000)
Me.Width
= GetSetting(App.Title, "Settings",
"MainWidth", 6500)
Me.Height
= GetSetting(App.Title, "Settings",
"MainHeight", 6500)
End
Sub
-----------------------------------------------------------------------------------------------------------------------
Private Sub Form_Unload(Cancel
As Integer)
Dim
i As Integer
'close all sub forms
For
i = Forms.Count - 1 To 1 Step -1
Unload
Forms(i)
Next
If
Me.WindowState
<> vbMinimized Then
SaveSetting
App.Title, "Settings",
"MainLeft", Me.Left
SaveSetting App.Title, "Settings",
"MainTop", Me.Top
SaveSetting App.Title, "Settings",
"MainWidth", Me.Width
SaveSetting App.Title, "Settings",
"MainHeight", Me.Height
End If
End Sub
-----------------------------------------------------------------------------------------------------------------------
Private Sub mnuDataBook_Click()
Dim f As New Book
f.Show
End Sub
----------------------------------------------------------------------------------------------------------------------
Private Sub mnuFileExit_Click()
'unload the form
Unload Me
End Sub |
|