home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / resize_1 / resizeco.ctl < prev    next >
Encoding:
Text File  |  1999-07-19  |  2.0 KB  |  71 lines

  1. VERSION 5.00
  2. Begin VB.UserControl ResizeControl 
  3.    ClientHeight    =   285
  4.    ClientLeft      =   0
  5.    ClientTop       =   0
  6.    ClientWidth     =   285
  7.    InvisibleAtRuntime=   -1  'True
  8.    Picture         =   "ResizeControl.ctx":0000
  9.    ScaleHeight     =   285
  10.    ScaleWidth      =   285
  11.    ToolboxBitmap   =   "ResizeControl.ctx":030A
  12. End
  13. Attribute VB_Name = "ResizeControl"
  14. Attribute VB_GlobalNameSpace = False
  15. Attribute VB_Creatable = True
  16. Attribute VB_PredeclaredId = False
  17. Attribute VB_Exposed = True
  18. Option Explicit
  19. Public Property Get MaxHeight() As Long
  20.     MaxHeight = lngMaxHeight
  21. End Property
  22. Public Property Let MaxHeight(ByVal lngNewValue As Long)
  23.     lngMaxHeight = lngNewValue
  24. End Property
  25. Public Property Get MaxWidth() As Long
  26.     MaxWidth = lngMaxWidth
  27. End Property
  28.  
  29. Public Property Let MaxWidth(ByVal lngNewValue As Long)
  30.     lngMaxWidth = lngNewValue
  31. End Property
  32.  
  33. Public Property Get MinHeight() As Long
  34.     MinHeight = lngMinHeight
  35. End Property
  36.  
  37. Public Property Let MinHeight(ByVal lngNewValue As Long)
  38.     lngMinHeight = lngNewValue
  39. End Property
  40. Public Property Get MinWidth() As Long
  41.     MinWidth = lngMinWidth
  42. End Property
  43.  
  44. Public Property Let MinWidth(ByVal lngNewValue As Long)
  45.     lngMinWidth = lngNewValue
  46. End Property
  47.  
  48. Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
  49.     MaxHeight = PropBag.ReadProperty("MaxHeight", 1)
  50.     MinHeight = PropBag.ReadProperty("MinHeight", 2)
  51.     MaxWidth = PropBag.ReadProperty("MaxWidth", 3)
  52.     MinWidth = PropBag.ReadProperty("MinWidth", 4)
  53.  
  54.     lngHwnd = UserControl.Parent.hWnd
  55.     Hook
  56. End Sub
  57. Private Sub UserControl_Resize()
  58.     UserControl.Width = 285
  59.     UserControl.Height = 285
  60. End Sub
  61. Private Sub UserControl_Terminate()
  62.     Unhook
  63. End Sub
  64.  
  65. Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
  66.     PropBag.WriteProperty "MaxHeight", MaxHeight
  67.     PropBag.WriteProperty "MinHeight", MinHeight
  68.     PropBag.WriteProperty "MaxWidth", MaxWidth
  69.     PropBag.WriteProperty "MinWidth", MinWidth
  70. End Sub
  71.