读书人

懂VB的高手们帮帮小弟,小弟有个有关问

发布时间: 2012-03-11 18:15:38 作者: rapoo

懂VB的高手们帮帮小弟,小弟有个问题不太明白
在创建浏览器对象的时候,请问以下两种创建方法有什么不一样呢?

Set a = CreateObject("InternetExplorer.Application")

Dim a As New InternetExplorer

这两个有什么区别呢?

为什么用第一种创建对象后,我使用a.Visible这个属性是可以赋值的.当我使用第二种创建对象的方法时,却不可以使用

a.Visible呢?我想知道如果想创建浏览器对象的哪个方法好呢?

懂的高手帮忙小弟一下了,不胜感激

[解决办法]

VB code
ption ExplicitPrivate Sub Command1_Click()    Dim a As Object    Set a = CreateObject("InternetExplorer.Application")    a.Visible = TrueEnd SubPrivate Sub Command2_Click()    Dim a As InternetExplorer    Set a = New InternetExplorer    a.Visible = TrueEnd Sub 

读书人网 >VB

热点推荐