VERSION 5.00
Begin VB.UserControl SimpleButton 
   Alignable       =   -1  'True
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   ClientHeight    =   3600
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   4800
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   ScaleHeight     =   240
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   320
   ToolboxBitmap   =   "SimpleButton.ctx":0000
   Begin VB.PictureBox PicHolder 
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1095
      Left            =   810
      ScaleHeight     =   1095
      ScaleWidth      =   1410
      TabIndex        =   0
      Top             =   495
      Width           =   1410
   End
End
Attribute VB_Name = "SimpleButton"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Event Click()
Event DblClick()
Event KeyDown(KeyCode As Integer, Shift As Integer)
Event KeyPress(KeyAscii As Integer)
Event KeyUp(KeyCode As Integer, Shift As Integer)
Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Public Property Get BackColor() As OLE_COLOR
Attribute BackColor.VB_Description = "Returns/sets the background color used to display text and graphics in an object."
BackColor = picHolder.BackColor
End Property
Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
picHolder.BackColor() = New_BackColor
PropertyChanged "BackColor"
End Property
Public Property Get BorderStyle() As Integer
Attribute BorderStyle.VB_Description = "Returns/sets the border style for an object."
BorderStyle = picHolder.BorderStyle
End Property
Public Property Let BorderStyle(ByVal New_BorderStyle As Integer)
picHolder.BorderStyle() = New_BorderStyle
PropertyChanged "BorderStyle"
End Property
Private Sub PicHolder_Click()
RaiseEvent Click
End Sub
Private Sub PicHolder_DblClick()
RaiseEvent DblClick
End Sub
Private Sub PicHolder_KeyDown(KeyCode As Integer, Shift As Integer)
RaiseEvent KeyDown(KeyCode, Shift)
End Sub
Private Sub PicHolder_KeyPress(KeyAscii As Integer)
RaiseEvent KeyPress(KeyAscii)
End Sub
Private Sub PicHolder_KeyUp(KeyCode As Integer, Shift As Integer)
RaiseEvent KeyUp(KeyCode, Shift)
End Sub
Private Sub PicHolder_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseMove(Button, Shift, X, Y)
End Sub
Private Sub PicHolder_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
UserControl.picHolder.BorderStyle = 0
RaiseEvent MouseUp(Button, Shift, X, Y)
End Sub
Private Sub PicHolder_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
UserControl.picHolder.BorderStyle = 1
RaiseEvent MouseDown(Button, Shift, X, Y)
End Sub
Public Property Get Picture() As Picture
Attribute Picture.VB_Description = "Returns/sets a graphic to be displayed in a control."
Set Picture = picHolder.Picture
End Property
Public Property Set Picture(ByVal New_Picture As Picture)
Set picHolder.Picture = New_Picture
UserControl.Width = picHolder.Width * Screen.TwipsPerPixelX
UserControl.Height = picHolder.Height * Screen.TwipsPerPixelY
PropertyChanged "Picture"
End Property
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
picHolder.BackColor = PropBag.ReadProperty("BackColor", &H8000000F)
picHolder.BorderStyle = PropBag.ReadProperty("BorderStyle", 0)
Set Picture = PropBag.ReadProperty("Picture", Nothing)
End Sub
Private Sub UserControl_Resize()

    With UserControl.picHolder
    .Left = 0
    .Top = 0
    .Width = UserControl.ScaleWidth
    .Height = UserControl.ScaleHeight
    End With

End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("BackColor", picHolder.BackColor, &H8000000F)
Call PropBag.WriteProperty("BorderStyle", picHolder.BorderStyle, 0)
Call PropBag.WriteProperty("Picture", Picture, Nothing)
End Sub
