VB.NET 2003 Properties with Parameters don't always seem to work properly in the Designer.
-
I wrote a Designer module to display my custom component and allow the various properties to be accessed in the properties pannel. Then I thought I would add an optional parameter with a default value of space to the properties that manage the styles for three of the subcomponents that are expressed as strings. My code would see the space and use the content of the Value parameter to control the entire style string value. If something other than a space were seen then it would be used as the name of the attribute, and the content of Value would be the value of that attribute. With all of this said, it didn't work, but wouldn't really tell my why, even when using the debugger set up to debug during the design time. I had already used the same technique to expose a user property that used an optional parameter to provide an index into an array of strings managed by the property which worked fine, but because I have yet to figure out how to write my own property dialog to expose the optional index parameter, only the top most element is accessible through the property pannel, but from within my back-end code I could access the other elements using the parameter fine. With that success, sort of, I thought I would use the optional parameter to provide a way to ask for the style attributes with the string managed by another property, but that's when the gray box of death started displaying for my component. While floating your mouse pointer over one of these boxes you would see that the specific style property could not be set to the values from the associated aspx component style property, but walking the execution through the debugger didn't find any problems, and the components rendered properly and worked just fine in the client-page. Anyway I finally discovered the source of the problem when I tore-down my code and tried removeing the various things I had done since the last working copy I had in source safe, and found that only removign the parameter from the property fixed the problem, even though none of the code actually used the parameter.