I want to create a new control without any reference to an exisiting control on a form

Hello,
       Is it possible to create an inet control inside a class with out using a form a or control placed on the form.
For instance I don't want

Set myTextBox = new form1.textbox1

I want to create a new control without any reference to an exisiting control on a form.

Thanks

LVL 3
Arundel_CastleAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
inthedarkConnect With a Mentor Commented:
Yes..

1) In the project where your class is create a dummy form with an Inet ontrol on it.

2) In the class decs you need code like this:

Dim MyfrmDummy As FrmDummy
Dim WithEvents INET1 As INet

3) In the class initiaize you need code like this:

Set myfrmDummy = New frmDummy ' note the use of the New keyword
Set INET = frmDummy.INet1

The INet in your class will now receive all events etc.

When closing the class just:
Set INet = Nothing
Set MyFrmDummy = Nothing

Hope this helps:~)
0
 
zzzzzoocConnect With a Mentor Commented:
If you don't need to know the interface (for WithEvents) and don't mind late-binding:

    Dim objInet As Object
    Set objInet = CreateObject("InetCtls.Inet.1")
    Call MsgBox(objInet.OpenURL("www.yahoo.com"))
0
 
Arundel_CastleAuthor Commented:
Thanks for the help guys.
0
All Courses

From novice to tech pro — start learning today.