home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / test_lay / testlay.bas < prev    next >
Encoding:
BASIC Source File  |  1994-05-18  |  1.4 KB  |  37 lines

  1. ' TestLay.Bas - Subroutines, Functions and Variables used by TestLay.Mak
  2. ' 94/05/18 Copyright 1994, Larry Rebich, The Bridge, Inc.
  3.     Option Explicit
  4.     DefInt A-Z
  5.  
  6. ' Global Grid Constants
  7.     Global Const GridFileName = "TestLay.Lay"   'store grid layouts here
  8.     Global GridPathAndFileName As String        'full path and file name of layout file
  9.     
  10.     Global Const GridDBName = "TestLay.Mdb"     'database name
  11.     
  12.     Global Const GridForTable = "TestLay"       'table identifier with saved file
  13.  
  14. ' Which grid setting, can be any name and more than two
  15.     Global Const GridFactory = "Factory"
  16.     Global Const GridCurrent = "Current"
  17.  
  18. Function AddBackSlash (ThePath As String) As String
  19.     If Right$(ThePath, 1) <> "\" Then
  20.         ThePath = ThePath + "\"
  21.     End If
  22.     AddBackSlash = ThePath
  23. End Function
  24.  
  25. Sub CenterForm (TheForm As Form, OffsetLeft As Integer, OffsetTop As Integer)
  26.     Dim FLeft As Integer
  27.     Dim FTop As Integer
  28. '    Debug.Print "Screen.Width= " & Str$(Screen.Width)
  29. '    Debug.Print "Screen.Height=" & Str$(Screen.Height)
  30.     If TheForm.WindowState <> 0 Then Exit Sub
  31.     FLeft = ((Screen.Width - TheForm.Width) \ 2) + OffsetLeft           'Center form horizontally.
  32.     FTop = (((Screen.Height - TheForm.Height) \ 2) + OffsetTop) * .85   'Center form vertically.
  33.     If TheForm.Left = FLeft And TheForm.Top = FTop Then Exit Sub
  34.     TheForm.Move FLeft, FTop
  35. End Sub
  36.  
  37.