Results 1 to 9 of 9

Thread: Create ActiveX at Runtime [Resolved]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    Belfast, N. Ireland
    Posts
    167

    Create ActiveX at Runtime [Resolved]

    Hi,

    Is it possible to create an instance of the Microsoft Web Browser ActiveX Control and place it on a form at runtime?

    Are there no .NET components for web browsing?

    Thanks!

    Justin.
    Last edited by Justy; Sep 23rd, 2003 at 06:22 AM.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    No , there is no pure .NET Web Browser control . I think you can do it why not .

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    Belfast, N. Ireland
    Posts
    167
    Any idea how you can do it?

    Isn't quite working out for me... tried adding a reference of the web browser dll and creating a new instance, but not sure how I go about placing this on a form...

  4. #4
    Hyperactive Member
    Join Date
    May 2002
    Location
    Wisconsin, USA
    Posts
    279
    Some one should create a pure .NET web browser component. That would be cool.

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Right click on the toolbox , add and remove items , Com tab , scroll down to Microsoft Web Browser , OK . It's there . Drop it on your form , size it however you like .

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    Belfast, N. Ireland
    Posts
    167
    Thanks pirate.. but I need to generate the control at Runtime, not using the IDE

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    Belfast, N. Ireland
    Posts
    167
    bump!

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    After you add reference to Microsoft Web Browser , just paste this code to create an instance of it .
    VB Code:
    1. Public Sub CreateIt()
    2.         Dim MyWBrowser As New AxSHDocVw.AxWebBrowser
    3.         MyWBrowser.Enabled = True
    4.         MyWBrowser.Location = New System.Drawing.Point(200, 200)
    5.         MyWBrowser.Size = New System.Drawing.Size(300, 300)
    6.         Me.Controls.Add(MyWBrowser)
    7.     End Sub

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    Belfast, N. Ireland
    Posts
    167
    Thats great, thanks mate!

    I was trying to create an instance of SHDocVw instead of AxSHDocVw and so the control collection was having none of it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width