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

📄 frmtest.frm

📁 Visual Basic 6 大学教程的代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmTester 
   AutoRedraw      =   -1  'True
   Caption         =   "IEmployee2 Delegation Example"
   ClientHeight    =   1650
   ClientLeft      =   4680
   ClientTop       =   5175
   ClientWidth     =   6660
   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     =   1650
   ScaleWidth      =   6660
End
Attribute VB_Name = "frmTester"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Form module to exercise IEmployee2,
' CBoss2 and CComissionWorker2
Option Explicit
Private mEmployeeRef As IEmployee2
Private mBoss As New CBoss2
Private mCommissionWorker As New CCommissionWorker2

Private Sub Form_Load()
   Set mEmployeeRef = mBoss
   
   mEmployeeRef.FirstName = "John"
   mEmployeeRef.LastName = "Smith"
   mBoss.WeeklySalary = 800
      
   Call Display(mBoss)
   
   Set mEmployeeRef = mCommissionWorker
   
   With mCommissionWorker
      .Commission = 3
      .Salary = 400
      .Quantity = 150
   End With
   
   mEmployeeRef.FirstName = "Sue"
   mEmployeeRef.LastName = "Jones"
   
   Call Display(mCommissionWorker)
End Sub

Private Sub Display(e As IEmployee2)
   
   If (TypeOf e Is CBoss2) Then
      Print "Type CCBoss2"
   ElseIf (TypeOf e Is CCommissionWorker2) Then
      Print "Type CCommissionWorker2"
   End If
   
   Print e.ToString & " earned " & FormatCurrency(e.Earnings)
   Print
End Sub

Private Sub Form_Terminate()
   Set mBoss = Nothing
   Set mCommissionWorker = Nothing
   Set mEmployeeRef = Nothing
End Sub

⌨️ 快捷键说明

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