by The Manic Mouse :<@ (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 6th October 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Remembers your forms location and size...
API Declarations
Dim YY As Single
Path = Trim(Path)
If Right(Path, 1) = "\" Then
CheckPath = Path
Else
CheckPath = Path & "\"
End If
End Function
Private Sub Form_Load()
Dim vLeft As String, vTop As String, vWidth As String, vHeight As String, vState As String
Open CheckPath(App.Path) & "pos.ini" For Input As #1
Line Input #1, vLeft
Line Input #1, vTop
Line Input #1, vWidth
Line Input #1, vHeight
Line Input #1, vState
Close #1
Me.Move Val(vLeft), Val(vTop), Val(vWidth), Val(vHeight)
Me.WindowState = Val(vState)
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim vLeft As String, vTop As String, vWidth As String, vHeight As String, vState As String
Open CheckPath(App.Path) & "pos.ini" For Output As #1
Print #1, Me.Left
Print #1, Me.Top
Print #1, Me.Width
Print #1, Me.Height
Print #1, Me.WindowState
Close #1
End Sub