VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

common code for several forms to set position like Left, Top, Width, Height and windowstate

Ali Atiq  (5 Submissions)   Custom Controls/Forms/Menus   Visual Basic 5.0   Unknown Difficulty   Fri 9th August 2002   Mon 8th February 2021

common code for several forms to set position like Left, Top, Width, Height and windowstate

API Declarations



Public Sub GetFormSetting(f As Form)
Dim fLeft$, fTop$, fWidth$, fHeight$, WinState%
WinState% = GetSetting(App.EXEName, f.Name, "WindoState", 0)
If WinState% > vbNormal Then
f.WindowState = WinState%
Else
fLeft$ = GetSetting(App.EXEName, f.Name, "Left", 100)
fTop$ = GetSetting(App.EXEName, f.Name, "Top", 100)
fWidth$ = GetSetting(App.EXEName, f.Name, "Width", 100)
fHeight$ = GetSetting(App.EXEName, f.Name, "Height", 100)
f.Left = fLeft$
f.Top = fTop$
f.Width = fWidth$
f.Height = fHeight$
End If
End Sub

Public Sub SaveFoemSetting(f As Form)
SaveSetting App.EXEName, f.Name, "Left", f.Left
SaveSetting App.EXEName, f.Name, "Top", f.Top
SaveSetting App.EXEName, f.Name, "Width", f.Width
SaveSetting App.EXEName, f.Name, "Height", f.Height
If f.WindowState <> vbMinimized Then
SaveSetting App.EXEName, f.Name, "WindoState", f.WindowState
End If
End Sub


Rate common code for several forms to set position like Left, Top, Width, Height and windowstate (2(2 Vote))
common code for several forms to set position like Left, Top, Width, Height and windowstate.bas

common code for several forms to set position like Left, Top, Width, Height and windowstate Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters