VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsHex"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'local variable(s) to hold property value(s)
Private mvarCanvas As Object 'local copy
Private mvarDist As Long 'local copy
Private mvarPointX As Long 'local copy
Private mvarPointY As Long 'local copy
Public Sub Draw()
    '//----CHANGE THIS------
    '// It doesnt work, you'll get a septagon (7 sides)
    '// Just replace all of the code here with a working
    '// algorithm, that uses the Line method.  mvarCanvas
    '// is the object to use to draw. mvarDist is the distance
    '// from the center (mvarPointX, mvarPointY), to a vertex
    '//                                 Good Luck! --Zaei
    
    Const RAD = 180 / 3.14159
    Dim i As Byte
    Dim t As Single
    Dim LastX As Single
    Dim LastY As Single

    t = (RAD * (360 / 6))
    LastX = mvarPointX + mvarDist * Cos(t)
    LastY = mvarPointY + mvarDist * Sin(t)
    For i = 0 To 5
        LastX = mvarPointX + mvarDist * Cos(t)
        LastY = mvarPointY + mvarDist * Sin(t)
        t = t + (RAD * (360 / 6))
        mvarCanvas.Line (LastX, LastY)-(mvarPointX + mvarDist * Cos(t), mvarPointY + mvarDist * Sin(t))
    Next i
    LastX = mvarPointX + mvarDist * Cos(RAD * (360 / 6))
    LastY = mvarPointY + mvarDist * Sin(RAD * (360 / 6))
    mvarCanvas.Line -(LastX, LastY)
End Sub

Public Property Let PointY(ByVal vData As Long)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.PointY = 5
    mvarPointY = vData
End Property


Public Property Get PointY() As Long
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.PointY
    PointY = mvarPointY
End Property



Public Property Let PointX(ByVal vData As Long)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.PointX = 5
    mvarPointX = vData
End Property


Public Property Get PointX() As Long
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.PointX
    PointX = mvarPointX
End Property



Public Property Let Dist(ByVal vData As Long)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.Dist = 5
    mvarDist = vData
End Property


Public Property Get Dist() As Long
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Dist
    Dist = mvarDist
End Property



Public Property Set Canvas(ByVal vData As Object)
'used when assigning an Object to the property, on the left side of a Set statement.
'Syntax: Set x.Canvas = Form1
    Set mvarCanvas = vData
End Property


Public Property Get Canvas() As Object
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Canvas
    Set Canvas = mvarCanvas
End Property



