Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Exposing UserControl events to IE

Exposing UserControl events to IE

Scheduled Pinned Locked Moved Visual Basic
csharpwinformscom
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    glaidler
    wrote on last edited by
    #1

    Hi, I've created a .net Windows forms user control that is housed within IE. All the methods of the usercontrol work fine, but I can't get the events to filter through to IE. I've read quite a bit about both the new event model in .net and how you need to explicitly create an interface in order to expose events to COM, however, after trying all sorts of examples, I just can't get it to work. The code currently looks like (having removed the system generated code): ==================================================================== Option Explicit On Option Strict On Imports System Imports System.Runtime.InteropServices 'Public Delegate Sub newCallDelegate(ByVal URN As Integer) 'Step 1: Define an event sink interface (ButtonEvents) to be 'implemented by the COM sink. _ Interface WebflowEvents Event newCall(ByVal URN As Integer) End Interface 'Step 2: Connect the event sink interface to a class 'by passing the namespace and event sink interface '("EventSource.ButtonEvents, EventSrc"). _ Public Class UserControl1 Inherits System.Windows.Forms.UserControl Implements WebflowEvents Public Event newCall(ByVal URN As Integer) Implements WebflowEvents.newCall Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MsgBox("Firing") RaiseEvent newCall(1234) End Sub End Class ================================================================================= I REALLY need to get this to work, otherwise it's back to registration of a COM wrapper. thanks Graham

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups