<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : [SOLVED] PropertyEnumItem index?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Property Grid : [SOLVED] PropertyEnumItem index?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 15 May 2026 05:19:53 +0000</pubDate>
  <lastBuildDate>Tue, 11 Jan 2011 10:33:29 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=17758</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[[SOLVED] PropertyEnumItem index? : Thank you again, Aaron! ]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17758&amp;PID=62166&amp;title=solved-propertyenumitem-index#62166</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=489">rdeboer</a><br /><strong>Subject:</strong> 17758<br /><strong>Posted:</strong> 11 January 2011 at 10:33am<br /><br />Thank you again, Aaron!&nbsp;<div><br></div><div><img src="http://forum.codejock.com/smileys/smiley1.gif" border="0" alt="Smile" title="Smile" /><br></div>]]>
   </description>
   <pubDate>Tue, 11 Jan 2011 10:33:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17758&amp;PID=62166&amp;title=solved-propertyenumitem-index#62166</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] PropertyEnumItem index? : Hi, Your stupidity is forgiven...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17758&amp;PID=62114&amp;title=solved-propertyenumitem-index#62114</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 17758<br /><strong>Posted:</strong> 07 January 2011 at 1:36am<br /><br /><P>Hi,</P><P>Your stupidity is forgiven <img src="http://forum.codejock.com/smileys/smiley2.gif" height="17" width="17" border="0" alt="Wink" title="Wink" /></P><DIV>Constraints collection&nbsp;isn't zero based, first item will start at 1 <img src="http://forum.codejock.com/smileys/smiley5.gif" height="17" width="17" border="0" alt="C&#111;nfused" title="C&#111;nfused" /></DIV><DIV>So if you would add constraint: </DIV><UL><LI>.Constraints.&nbsp;Add "First item", 0</LI><LI>.Constraints.&nbsp;Add "Second item", 1</LI><LI>.Constraints.&nbsp;Add "Third item", 2</LI></UL><DIV>and want to get the index of the first item, it will produce an error because there is no constraint with index 0&nbsp;&nbsp;</DIV><DIV>In this case you have to set Item.value + 1 </DIV><UL><LI>Me.wndPropertyGrid.FindItem(ITEM.ID or "Caption").Constraints(Me.wndPropertyGrid.FindItem(ITEM.ID or "Caption").<strong>Value + 1</strong>).Data (or index)</LI></UL><DIV></DIV><DIV></DIV>If you&nbsp;don't use successive numbers for the &lt;Data&gt;&nbsp;for the added constraints above doesn't work<UL><LI>.Constraints.&nbsp;Add "First item", 0</LI><LI>.Constraints.&nbsp;Add "Second item", 1</LI><LI>.Constraints.&nbsp;Add "Third item", 2</LI><LI>.Constraints.&nbsp;Add "Third item", 4</LI><LI>.Constraints.&nbsp;Add "Third item", 8</LI></UL><P>In this case you have to loop constraints and compare constraint, annoying thing to do (in my opinion...)</P><DIV>&nbsp;</DIV><DIV>Best way is to start added constraint with &lt;Data&gt; = 1 and use successive numbers, this way you are able to use Item.Value to "find" selected&nbsp;constraint.</DIV><DIV>&nbsp;</DIV><DIV>Hope this helps <img src="http://forum.codejock.com/smileys/smiley2.gif" height="17" width="17" border="0" alt="Wink" title="Wink" /></DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 07 Jan 2011 01:36:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17758&amp;PID=62114&amp;title=solved-propertyenumitem-index#62114</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] PropertyEnumItem index? : How? I tried:Set Itemx = Advan...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17758&amp;PID=62113&amp;title=solved-propertyenumitem-index#62113</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=489">rdeboer</a><br /><strong>Subject:</strong> 17758<br /><strong>Posted:</strong> 06 January 2011 at 5:06pm<br /><br />How? I tried:<div><br></div><div><div>Set Itemx = AdvancedGrid.FindItem("Enum")</div><div>If Not (Itemx Is Nothing) Then</div><div>&nbsp;&nbsp; &nbsp;Debug.Print Itemx.Constraints(Itemx.Value)</div><div>End If</div></div><div><br></div><div>But that gives an error?</div><div><br></div><div>Excuse my stupidity :)</div><div><br></div><div><br></div>]]>
   </description>
   <pubDate>Thu, 06 Jan 2011 17:06:13 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17758&amp;PID=62113&amp;title=solved-propertyenumitem-index#62113</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] PropertyEnumItem index? : SameItemEnum.Value will work later....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17758&amp;PID=62111&amp;title=solved-propertyenumitem-index#62111</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 17758<br /><strong>Posted:</strong> 06 January 2011 at 4:29pm<br /><br />Same&nbsp;<span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">&nbsp;ItemEnum.Value will work later.</span>]]>
   </description>
   <pubDate>Thu, 06 Jan 2011 16:29:28 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17758&amp;PID=62111&amp;title=solved-propertyenumitem-index#62111</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] PropertyEnumItem index? :  I use code similar like this:...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17758&amp;PID=62107&amp;title=solved-propertyenumitem-index#62107</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=489">rdeboer</a><br /><strong>Subject:</strong> 17758<br /><strong>Posted:</strong> 06 January 2011 at 4:16pm<br /><br />I use code similar like this:<div><br></div><div><div>&nbsp;&nbsp; &nbsp;Dim ItemEnum As PropertyGridItem</div><div>&nbsp;&nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp;'Adds a PropertyItemEnum item with a caption of "Enum" and an initial value of 2</div><div>&nbsp;&nbsp; &nbsp;'This will cause the constraint with a value of 2 to be selected</div><div>&nbsp;&nbsp; &nbsp;Set ItemEnum = Category.AddChildItem(PropertyItemEnum, "Enum", 2)</div><div>&nbsp;&nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp;'Adds some constraints along with a Data value</div><div>&nbsp;&nbsp; &nbsp;ItemEnum.Constraints.Add "Windows 98", 1</div><div>&nbsp;&nbsp; &nbsp;ItemEnum.Constraints.Add "Windows 2000", 2</div><div>&nbsp;&nbsp; &nbsp;ItemEnum.Constraints.Add "Windows XP", 3</div></div><div><br></div><div>Now while ItemEnum is active, you can read the value of the selected item:</div><div><br></div><div>Debug.Print "Enum Item Value =" &amp; ItemEnum.Value</div><div><br></div><div>So far so good. But how do i find this value later in the program?</div><div><br></div><div>The old VB method would be:</div><div><br></div><div>Value = cmbBox.ListIndex</div><div><br></div><div>to find the listindex of the currently selected item.</div><div><br></div><div>How do i find 'ListIndex' in PropertyGrid? lets say i selected Windows 2000, the listindex would be 2.</div><div><br></div><div><br></div><div><br></div><div><br></div>]]>
   </description>
   <pubDate>Thu, 06 Jan 2011 16:16:37 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17758&amp;PID=62107&amp;title=solved-propertyenumitem-index#62107</guid>
  </item> 
 </channel>
</rss>