home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / Basic / GridOne / setup.EXE / COMMON.BAS < prev    next >
Encoding:
BASIC Source File  |  2001-09-09  |  3.0 KB  |  92 lines

  1. Attribute VB_Name = "modGridHelpers"
  2. '-----------------------------------------------------------------------------
  3. ' This is a part of the BeeGrid ActiveX control.
  4. ' Copyright ⌐ 2000 Stinga
  5. ' All rights reserved.
  6. '
  7. ' You have a right to use and distribute the BeeGrid sample files in original
  8. ' form or modified, provided that you agree that Stinga has no warranty,
  9. ' obligations, or liability for any sample application files.
  10. '-----------------------------------------------------------------------------
  11. Option Explicit
  12.  
  13.  
  14. Public Const SW_NORMAL = 1
  15. Public Const SW_MINIMIZE = 6
  16. Public Const SW_MAXIMIZE = 3
  17.  
  18. Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  19.  
  20.  
  21. Public Sub RightAlignButtons(frm As Form, _
  22.                              btns As Object, _
  23.                              Right As Single)
  24.                              
  25.    Dim nLBound&, nUBound&, I&
  26.    
  27.    If TypeName(btns) = "CommandButton" Then
  28.       btns.Left = frm.ScaleWidth - Right - btns.Width
  29.    Else
  30.       nLBound = btns.LBound
  31.       nUBound = btns.UBound
  32.       For I = nLBound To nUBound
  33.          btns(I).Left = frm.ScaleWidth - Right - btns(I).Width
  34.       Next
  35.    End If
  36. End Sub
  37.  
  38. Public Sub RightAlignControl(frm As Form, _
  39.                              ctrl As Object, _
  40.                              Right As Single)
  41.                              
  42.    ctrl.Left = frm.ScaleWidth - Right - ctrl.Width
  43. End Sub
  44.  
  45. Public Sub RightBottomAlignControl(frm As Form, _
  46.                                    ctrl As Object, _
  47.                                    Right As Single, _
  48.                                    Bottom As Single)
  49.                              
  50.    ctrl.Left = frm.ScaleWidth - Right - ctrl.Width
  51.    ctrl.Top = frm.ScaleHeight - Bottom - ctrl.Height
  52. End Sub
  53.  
  54. Public Sub BottomAlignControl(frm As Form, _
  55.                               ctrl As Object, _
  56.                               Bottom As Single)
  57.                              
  58.    ctrl.Top = frm.ScaleHeight - Bottom - ctrl.Height
  59. End Sub
  60.  
  61. Public Sub AlignGrid(frm As Form, _
  62.                      grid As Object, _
  63.                      Left As Single, _
  64.                      Top As Single, _
  65.                      Right As Single, _
  66.                      Bottom As Single)
  67.  
  68.    grid.Left = Left
  69.    grid.Top = Top
  70.    
  71.    Dim W As Single
  72.    W = frm.ScaleWidth - grid.Left - Right
  73.    If W < 1000 Then W = 1000
  74.    grid.Width = W
  75.    
  76.    Dim H As Single
  77.    H = frm.ScaleHeight - grid.Top - Bottom
  78.    If H < 1000 Then H = 1000
  79.    grid.Height = H
  80. End Sub
  81.  
  82.  
  83. Public Sub CheckFreeEdition(grid As Object)
  84.    If InStr(grid.Version, "Free") > 0 Then
  85.       MsgBox "You are using BeeGrid Free Edition." & vbCrLf & vbCrLf & _
  86.              "This sample uses features not available in Free Edition." & vbCrLf & _
  87.              "Program will be terminated."
  88.       End
  89.    End If
  90. End Sub
  91.  
  92.