home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / Cash_Accou2121397222008.psc / Controls / ctlHotKeyLabel.ctl next >
Text File  |  2008-04-25  |  7KB  |  213 lines

  1. VERSION 5.00
  2. Begin VB.UserControl ctlHotKeyLabel 
  3.    ClientHeight    =   270
  4.    ClientLeft      =   0
  5.    ClientTop       =   0
  6.    ClientWidth     =   1950
  7.    ScaleHeight     =   270
  8.    ScaleWidth      =   1950
  9.    Begin VB.Label Label1 
  10.       AutoSize        =   -1  'True
  11.       Caption         =   "Action"
  12.       BeginProperty Font 
  13.          Name            =   "MS Sans Serif"
  14.          Size            =   9.75
  15.          Charset         =   0
  16.          Weight          =   400
  17.          Underline       =   0   'False
  18.          Italic          =   0   'False
  19.          Strikethrough   =   0   'False
  20.       EndProperty
  21.       ForeColor       =   &H00FF0000&
  22.       Height          =   240
  23.       Left            =   600
  24.       MouseIcon       =   "ctlHotKeyLabel.ctx":0000
  25.       MousePointer    =   99  'Custom
  26.       TabIndex        =   1
  27.       Top             =   0
  28.       Width           =   555
  29.    End
  30.    Begin VB.Label lblHotKey 
  31.       AutoSize        =   -1  'True
  32.       Caption         =   "KeyIn"
  33.       BeginProperty Font 
  34.          Name            =   "MS Sans Serif"
  35.          Size            =   9.75
  36.          Charset         =   0
  37.          Weight          =   400
  38.          Underline       =   0   'False
  39.          Italic          =   0   'False
  40.          Strikethrough   =   0   'False
  41.       EndProperty
  42.       ForeColor       =   &H00000000&
  43.       Height          =   240
  44.       Left            =   0
  45.       TabIndex        =   0
  46.       Top             =   0
  47.       Width           =   495
  48.    End
  49. End
  50. Attribute VB_Name = "ctlHotKeyLabel"
  51. Attribute VB_GlobalNameSpace = False
  52. Attribute VB_Creatable = True
  53. Attribute VB_PredeclaredId = False
  54. Attribute VB_Exposed = False
  55. '//UNFINISHED CONTROL
  56. '// DESIGNED BY EDWIN DELOS SANTOS
  57. Private PixelX, PixelY
  58. Private ky As Long  'key in width
  59. Private ac As Long  'action key width
  60.  
  61. 'Event Declarations:
  62. Event Click() 'MappingInfo=Label1,Label1,-1,Click
  63. Event Change()
  64. Event Resize()
  65.  
  66.  
  67. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  68. 'MappingInfo=Label1,Label1,-1,Caption
  69. Public Property Get Caption() As String
  70.     Caption = Label1.Caption
  71. End Property
  72.  
  73. Public Property Let Caption(ByVal New_Caption As String)
  74.     Label1.Caption() = New_Caption
  75.     PropertyChanged "Caption"
  76. End Property
  77.  
  78. Public Property Get CaptionHotkey() As String
  79.     CaptionHotkey = lblHotKey.Caption
  80. End Property
  81.  
  82. Public Property Let CaptionHotkey(ByVal New_Caption As String)
  83.     lblHotKey.Caption() = New_Caption
  84.     PropertyChanged "CaptionHotkey"
  85. End Property
  86.  
  87. Private Sub Label1_Click()
  88.    RaiseEvent Click
  89. End Sub
  90.  
  91. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  92. 'MappingInfo=Label1,Label1,-1,ForeColor
  93. Public Property Get ForeColor() As OLE_COLOR
  94.     ForeColor = Label1.ForeColor
  95. End Property
  96.  
  97. Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
  98.     Label1.ForeColor() = New_ForeColor
  99.     PropertyChanged "ForeColor"
  100. End Property
  101.  
  102. Public Property Get ForeColorHotKey() As OLE_COLOR
  103.     ForeColorHotKey = lblHotKey.ForeColor
  104. End Property
  105.  
  106. Public Property Let ForeColorHotKey(ByVal New_ForeColor As OLE_COLOR)
  107.     lblHotKey.ForeColor() = New_ForeColor
  108.     PropertyChanged "ForeColorHotkey"
  109. End Property
  110.  
  111. Public Property Get BackColor() As OLE_COLOR
  112.     BackColor = Label1.BackColor
  113. End Property
  114.  
  115. Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
  116.     Label1.BackColor() = New_BackColor
  117.     UserControl.BackColor = Label1.BackColor
  118.     lblHotKey.BackColor = Label1.BackColor
  119.     PropertyChanged "BackColor"
  120.     
  121. End Property
  122.  
  123.  
  124. '
  125.  
  126. Public Sub UserControl_Initialize()
  127.   PixelX = Screen.TwipsPerPixelX
  128.  UserControl_Resize
  129. End Sub
  130.  
  131. Private Sub UserControl_Resize()
  132.  
  133. lblHotKey.Left = 0
  134. lblHotKey.Height = UserControl.ScaleHeight
  135. Label1.Width = UserControl.ScaleWidth
  136. Label1.Height = UserControl.ScaleHeight
  137. Label1.Left = lblHotKey.Width + PixelX
  138.  
  139. End Sub
  140.  
  141. 'Load property values from storage
  142. Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
  143.     Label1.Caption = PropBag.ReadProperty("Caption", Label1.Caption)
  144.     lblHotKey.Caption = PropBag.ReadProperty("CaptionHotkey", lblHotKey.Caption)
  145.     Label1.ForeColor = PropBag.ReadProperty("ForeColor", &H80000012)
  146.     Label1.BackColor = PropBag.ReadProperty("BackColor", &H8000000F)
  147.     lblHotKey.BackColor = PropBag.ReadProperty("BackColor", &H8000000F)
  148.     UserControl.BackColor = PropBag.ReadProperty("BackColor", &H8000000F)
  149.     lblHotKey.ForeColor = PropBag.ReadProperty("ForeColorHotKey", &H0&)
  150.     Set Font = PropBag.ReadProperty("Font", Ambient.Font)
  151.     Set Label1.Font = PropBag.ReadProperty("Font", Ambient.Font)
  152.     Set lblHotKey.Font = PropBag.ReadProperty("Font", Ambient.Font)
  153.     lblHotKey.Width = PropBag.ReadProperty("WidthHotkey", 495)
  154.     Label1.Left = PropBag.ReadProperty("Left", 495)
  155. End Sub
  156.  
  157. 'Write property values to storage
  158. Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
  159.     Call PropBag.WriteProperty("Caption", Label1.Caption, &H80000012)
  160.     Call PropBag.WriteProperty("CaptionHotkey", lblHotKey.Caption, &H80000012)
  161.     Call PropBag.WriteProperty("ForeColor", Label1.ForeColor, &H80000012)
  162.     Call PropBag.WriteProperty("BackColor", Label1.BackColor, &H8000000F)
  163.     Call PropBag.WriteProperty("BackColor", UserControl.BackColor, &H8000000F)
  164.     Call PropBag.WriteProperty("BackColor", lblHotKey.BackColor, &H8000000F)
  165.     Call PropBag.WriteProperty("ForeColorHotKey", lblHotKey.ForeColor, &H0&)
  166. '    Call PropBag.WriteProperty("BackColorHotkey", lblHotKey.BackColor, &H8000000F)
  167.     Call PropBag.WriteProperty("Font", Font, Ambient.Font)
  168.     Call PropBag.WriteProperty("Font", Label1.Font, Ambient.Font)
  169.     Call PropBag.WriteProperty("Font", lblHotKey.Font, Ambient.Font)
  170.     Call PropBag.WriteProperty("WidthHotkey", lblHotKey.Width, 495)
  171.     Call PropBag.WriteProperty("Left", Label1.Left, 495)
  172. End Sub
  173.  
  174. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  175. 'MappingInfo=Label1,Label1,-1,BackColor
  176. 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
  177. 'MappingInfo=Label1,Label1,-1,Font
  178.  
  179. Public Property Get Font() As Font
  180.     Set Font = Label1.Font
  181.     Set Font = lblHotKey.Font
  182. End Property
  183.  
  184. Public Property Set Font(ByVal New_Font As Font)
  185.     Set Label1.Font = New_Font
  186.     Set lblHotKey.Font = New_Font
  187.     PropertyChanged "Font"
  188. End Property
  189.  
  190. Public Property Get WidthHotkey() As Long
  191.     WidthHotkey = lblHotKey.Width
  192. End Property
  193.  
  194. Public Property Let WidthHotkey(ByVal New_Width As Long)
  195.     lblHotKey.Width() = New_Width
  196.     PropertyChanged "WidthHotkey"
  197. End Property
  198.  
  199. Public Property Get Left() As Long
  200.     Left = Label1.Left
  201. End Property
  202.  
  203. Public Property Let Left(ByVal New_Left As Long)
  204.     Label1.Left() = New_Left
  205.     PropertyChanged "Left"
  206. End Property
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.