I had a property like this in my test control:
public bool UseRedBackgroundColor { set { if (value == true) { this.BackColor = Color.Red; } } }
I had a param set in the object tag in my test HTML page to set the property to true, but the control didn't render with the red background:
<object id="XPTest" name="XPTest" classid="http:/webtest/XPStylesTest.dll #XPStylesTest.XPStylesTest" width="158" height="250"> <param name="UseRedBackgroundColor" value="True" /> </object>
I changed my public property to have a "get" section, and after a rebuild of the project and a reopen of IE, the control rendered with a red background as expected:
public bool UseRedBackgroundColor { get { return (this.BackColor == Color.Red); } set { if (value == true) { this.BackColor = Color.Red; } } }
So if a public property of a Windows Forms control hosted in IE isn't being activated as expected, check to make sure that a "get" section has been defined for the property.
No comments:
Post a Comment
Hi spammers! No need to waste your time here; comments are heavily moderated, so if you like, you can save us both a little time and just move on to the next site. :-)
For everyone else: Thanks for visiting! Your comments are more than welcome!