home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.UserControl MyCB
- ClientHeight = 2880
- ClientLeft = 0
- ClientTop = 0
- ClientWidth = 3840
- ScaleHeight = 2880
- ScaleWidth = 3840
- Begin VB.CommandButton Command1
- Caption = "Command1"
- Height = 400
- Left = 1440
- TabIndex = 0
- Top = 1200
- Width = 800
- End
- End
- Attribute VB_Name = "MyCB"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = True
- Private Declare Function mciSendString Lib _
- "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, _
- ByVal lpstrReturnString As String, _
- ByVal uReturnLength As Long, _
- ByVal hwndCallback As Long) As Long
-
- 'Default Property Values:
- Const m_def_BackColor = 0
- Const m_def_ForeColor = 0
- Const m_def_Enabled = 0
- Const m_def_BackStyle = 0
- Const m_def_BorderStyle = 0
- Const m_def_Sound = "c:\windows\media\tada.wav"
- 'Property Variables:
- Dim m_BackColor As Long
- Dim m_ForeColor As Long
- Dim m_Enabled As Boolean
- Dim m_Font As Font
- Dim m_BackStyle As Integer
- Dim m_BorderStyle As Integer
- Dim m_Sound As String
- 'Event Declarations:
- Event Click() 'MappingInfo=Command1,Command1,-1,Click
- Attribute Click.VB_Description = "Occurs when the user presses and then releases a mouse button over an object."
- Event DblClick()
- Attribute DblClick.VB_Description = "Occurs when the user presses and releases a mouse button and then presses and releases it again over an object."
- Event KeyDown(KeyCode As Integer, Shift As Integer)
- Attribute KeyDown.VB_Description = "Occurs when the user presses a key while an object has the focus."
- Event KeyPress(KeyAscii As Integer)
- Attribute KeyPress.VB_Description = "Occurs when the user presses and releases an ANSI key."
- Event KeyUp(KeyCode As Integer, Shift As Integer)
- Attribute KeyUp.VB_Description = "Occurs when the user releases a key while an object has the focus."
- Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Attribute MouseDown.VB_Description = "Occurs when the user presses the mouse button while an object has the focus."
- Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Attribute MouseMove.VB_Description = "Occurs when the user moves the mouse."
- Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Attribute MouseUp.VB_Description = "Occurs when the user releases the mouse button while an object has the focus."
-
-
-
- Public Property Get BackColor() As Long
- BackColor = m_BackColor
- End Property
-
- Public Property Let BackColor(ByVal New_BackColor As Long)
- m_BackColor = New_BackColor
- PropertyChanged "BackColor"
- End Property
-
- Public Property Get ForeColor() As Long
- ForeColor = m_ForeColor
- End Property
-
- Public Property Let ForeColor(ByVal New_ForeColor As Long)
- m_ForeColor = New_ForeColor
- PropertyChanged "ForeColor"
- End Property
-
- Public Property Get Enabled() As Boolean
- Enabled = m_Enabled
- End Property
-
- Public Property Let Enabled(ByVal New_Enabled As Boolean)
- m_Enabled = New_Enabled
- PropertyChanged "Enabled"
- End Property
-
- Public Property Get Font() As Font
- Set Font = m_Font
- End Property
-
- Public Property Set Font(ByVal New_Font As Font)
- Set m_Font = New_Font
- PropertyChanged "Font"
- End Property
-
- Public Property Get BackStyle() As Integer
- BackStyle = m_BackStyle
- End Property
-
- Public Property Let BackStyle(ByVal New_BackStyle As Integer)
- m_BackStyle = New_BackStyle
- PropertyChanged "BackStyle"
- End Property
-
- Public Property Get BorderStyle() As Integer
- BorderStyle = m_BorderStyle
- End Property
-
- Public Property Let BorderStyle(ByVal New_BorderStyle As Integer)
- m_BorderStyle = New_BorderStyle
- PropertyChanged "BorderStyle"
- End Property
-
- Public Sub Refresh()
-
- End Sub
-
- Private Sub Command1_Click()
- Call mciSendString("play " + Sound, 0, 0, 0)
- RaiseEvent Click
- End Sub
-
- 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
- 'MappingInfo=Command1,Command1,-1,Caption
- Public Property Get Caption() As String
- Caption = Command1.Caption
- End Property
-
- Public Property Let Caption(ByVal New_Caption As String)
- Command1.Caption() = New_Caption
- PropertyChanged "Caption"
- End Property
-
- Public Property Get Sound() As String
- Sound = m_Sound
- End Property
-
- Public Property Let Sound(ByVal New_Sound As String)
- m_Sound = New_Sound
- PropertyChanged "Sound"
- End Property
-
- 'Initialize Properties for User Control
- Private Sub UserControl_InitProperties()
- m_BackColor = m_def_BackColor
- m_ForeColor = m_def_ForeColor
- m_Enabled = m_def_Enabled
- Set m_Font = Ambient.Font
- m_BackStyle = m_def_BackStyle
- m_BorderStyle = m_def_BorderStyle
- m_Sound = m_def_Sound
- End Sub
-
- 'Load property values from storage
- Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
-
- m_BackColor = PropBag.ReadProperty("BackColor", m_def_BackColor)
- m_ForeColor = PropBag.ReadProperty("ForeColor", m_def_ForeColor)
- m_Enabled = PropBag.ReadProperty("Enabled", m_def_Enabled)
- Set m_Font = PropBag.ReadProperty("Font", Ambient.Font)
- m_BackStyle = PropBag.ReadProperty("BackStyle", m_def_BackStyle)
- m_BorderStyle = PropBag.ReadProperty("BorderStyle", m_def_BorderStyle)
- Command1.Caption = PropBag.ReadProperty("Caption", "Command1")
- m_Sound = PropBag.ReadProperty("Sound", m_def_Sound)
- End Sub
-
- 'Write property values to storage
- Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
-
- Call PropBag.WriteProperty("BackColor", m_BackColor, m_def_BackColor)
- Call PropBag.WriteProperty("ForeColor", m_ForeColor, m_def_ForeColor)
- Call PropBag.WriteProperty("Enabled", m_Enabled, m_def_Enabled)
- Call PropBag.WriteProperty("Font", m_Font, Ambient.Font)
- Call PropBag.WriteProperty("BackStyle", m_BackStyle, m_def_BackStyle)
- Call PropBag.WriteProperty("BorderStyle", m_BorderStyle, m_def_BorderStyle)
- Call PropBag.WriteProperty("Caption", Command1.Caption, "Command1")
- Call PropBag.WriteProperty("Sound", m_Sound, m_def_Sound)
- End Sub
-
-