views:

240

answers:

1

Hi,

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 subscripe 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

    }

Thanks!

A: 

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.

KMan
My problem is that I don't have any control on the web page I am hosted in. so using javascript is not an option for me.maybe I can get the pointer to the IE window and get the size that way, but I would like to get SizeChanged events, and not to manually check the window size each time
Shai Rubinshtein
Not sure, but I would look into something that would delegate the browser events - "some how" - to the ActiveX control so that it would react accordingly.
KMan