打印本文 打印本文 关闭窗口 关闭窗口
VBCOM TUTORIAL(2)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数1984  更新时间:2009/4/23 18:58:28  文章录入:mintao  责任编辑:mintao
how()     frm.Show ''''** show form and redraw     frm.Refresh   End Sub     Public Sub Hide()     frm.Hide ''''** erase form but leave form object in memory   End Sub

That''''s it, the class CProgress is now completely implemented!


Classes vs. Instances

Before we begin our discussion of COM, let''''s review the notion of  classes, and instances of classes.  Consider the following client code:

  Dim p1 As CProgress, p2 As CProgress, p3 As CProgress     Set p1 = New CProgress   Set p2 = New CProgress   Set p3 = New CProgress     p1.Value = 40   p2.Value = 5   p3.Value = 99     p1.Show   p2.Show   p2.Hide     Stop ''''** pause client and activate the debugger

How many instances of CProgress exist in memory?  Three!  How many progress indicator forms exist in memory (i.e. instances of frmProgress)?  Three!  How many of these form instances are visible on the screen?  One!  Okay, now you''''re ready to start the first lesson on.

上一页  [1] [2] 

打印本文 打印本文 关闭窗口 关闭窗口