2
votes

I have written an ActiveX user control in C#. That ActiveX control is hosted inside a legacy application running in IE that is written in Delphi. Everything works, my only problem is that I need to subscribe on events of the control that is hosting me (for example - resize event).

Currently I am unable to do that, and when I resize the IE window, my control does not get a SizeChanged event. I tried to subscribe on the parent control's events, but the parent control is listed as null. (I guess it's the Delphi issue.)

I want to know if there is a way to get this working (some interface I have to implement maybe?).

Here is an example of the code of my control:

    [
        ClassInterface(ClassInterfaceType.AutoDispatch),
        ComVisible(true),
        Guid("<some guid>"),
    ]
    public partial class MyActiveXControl : UserControl, IMyInterface
    {

        public MyActiveXControl()
        {
            InitializeComponent();
        }

        #region IScriptViewer Members

        //implement interface

        #endregion

    }
1

1 Answers

0
votes

How about you handle the control size in your WebPage. For instance, get the browser window size/changes, and then set the bounds of control manually. And if you want the controls within the control the re-arrange them, then probably call the OnSize event of the control.