home *** CD-ROM | disk | FTP | other *** search
Visual Basic class definition | 1997-06-16 | 1.3 KB | 52 lines |
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- END
- Attribute VB_Name = "CCircle"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = False
- Private m_x As Integer 'Distance from center of circle to left side of form
- Private m_y As Integer 'Distance from center of circle to top of form
- Private m_r As Single 'Radius of circle
-
- Private Sub Class_Initialize()
- Rem Set the initial center of the circle to the upper
- Rem left corner of the form and set its radius to 500.
- Let m_x = 0
- Let m_y = 0
- Let m_r = 500
- End Sub
-
- Public Property Get Xcoord() As Integer
- Let Xcoord = m_x
- End Property
-
- Public Property Let Xcoord(ByVal vNewValue As Integer)
- Let m_x = vNewValue
- End Property
-
- Public Property Get Ycoord() As Integer
- Let Ycoord = m_y
- End Property
-
- Public Property Let Ycoord(ByVal vNewValue As Integer)
- Let m_y = vNewValue
- End Property
-
- Public Sub Show()
- Rem Display the circle.
- Rem See discussion of Circle method in Section 10.4.
- frmCircles.Circle (m_x, m_y), m_r
- End Sub
-
- Public Sub Move(Dist)
- Rem Move the center of the circle Dist twips to the right
- Rem and Dist twips down.
- Let m_x = m_x + Dist
- Let m_y = m_y + Dist
- Call Show
- End Sub
-
-