⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmtest.frm

📁 Visual Basic 6 大学教程的代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   AutoRedraw      =   -1  'True
   Caption         =   "Polymorphism Example"
   ClientHeight    =   1395
   ClientLeft      =   3615
   ClientTop       =   4185
   ClientWidth     =   9360
   BeginProperty Font 
      Name            =   "MS Sans Serif"
      Size            =   12
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   ScaleHeight     =   1395
   ScaleWidth      =   9360
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Form module that exercises IShape2, CPoint,
' CCircle and CCylinder
Option Explicit
Option Base 1

Private Sub Form_Load()
   Dim k As Integer, shapes(3) As IShape2
   Dim p As New CPoint, c As New CCircle
   Dim cy As New CCylinder
   
   p.X = 333       ' Set X via Property Let
   p.Y = 444       ' Set Y via Property Let
   
   c.Radius = 10   ' Set Radius via Property Let
   c.X = 55        ' Set X via Property Let
   c.Y = 9         ' Set Y via Property Let
   
   cy.Radius = 2   ' Set Radius via Property Let
   cy.Height = 6   ' Set Height via Property Let
   cy.X = 20       ' Set X via Property Let
   cy.Y = 88       ' Set Y via Property Let
      
   Set shapes(1) = p    ' Create a CPoint
   Set shapes(2) = c    ' Create a CCircle
   Set shapes(3) = cy   ' Create a Cylinder
   
   For k = LBound(shapes) To UBound(shapes)
      Print shapes(k).Name() & " Area: " & _
            shapes(k).Area() & " Volume: " & _
            shapes(k).Volume() & " Attributes: " & _
            shapes(k).ToString()
   Next k
     
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -