WebControl rendering an ActiveX ctrl - design time problem

G

Gergely Varadi

I develop webcontrols that render ActiveX controls. In the
GetDesignTimeHTML() I simply call the MyControl.RenderControl() method
that generates the client-side code and appends some other HTML stuff:

public override string GetDesignTimeHtml()
{
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
((MyControl)this.Component).RenderControl(htw);

string sHTML = sw.ToString();
sHTML += "<p>Some info for debugging that in release I don't want.";
}

public override void RenderBeginTag{HtmlTextWriter writer)
{
writer.WriteBeginTag("OBJECT");
//Render ActiveX control of the given classid
writer.WriteAttribute("CLASSID", "clsid:" + this.ClassInfo);
...
}

Now the problem is that if I drop this webcontrol on an aspx page then
the mouse-actions work really strange:

-right-clicking on the webcontrol's surface gets me the right-click
popup menu (as desired) be it the ActiveX control or the "Some info
for debugging..." text.
-left-clicking on the webcontrol's surface depends. If I move the
mouse on the ActiveX, it has arrow-cursor swallowing the left-click,
yet moving on the text "Some info for debugging..." the mouse cursor
becomes a four direction arrow allowing me to move the control on the
page.

I presume that the ActiveX control gets window messages like in Visual
Inderdev it did. However, FrontPage can handle this situation.

Why this difference and how can I move a WebControl rendering solely
an ActiveX ctrl?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top