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