Adding Compact Framework Design-Time Attributes, DefaultValue Attributes

i was trying to add a dsign time attribute to one of my project. and the attribute was DefaultValue. i tried adding it following the example given here. But it didn’t work out for me. after experimenting for sometime i figured it out(with some help ;) ).

this is the example given in the above blog post.

        <Property Name="SelectAllOnFocus">
          <Browsable>true</Browsable>
          <Category>Behavior</Category>
          <Description>Determines whether the contents of the control should be selected when focus is moved to the control.</Description>

          <DefaultValue>
            <Type>bool</Type>
            <Value>false</Value>
          </DefaultValue>

        </Property>

but i needed to change it as follows to make it work for me.

        <Property Name="SelectAllOnFocus">
          <Browsable>true</Browsable>
          <Category>Behavior</Category>
          <Description>Determines whether the contents of the control should be selected when focus is moved to the control.</Description>

          <DefaultValue>
            <Type>System.Boolean</Type>
            <Value>false</Value>
          </DefaultValue>

        </Property>

basically i needed to give the full namespace to the type. like in System.Boolean... just bool won't work.
hope this will save some time for someone. :)

Leave a Reply