<?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 : REQUEST: Reference an inplacebutton?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Property Grid : REQUEST: Reference an inplacebutton?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 16:15:59 +0000</pubDate>
  <lastBuildDate>Tue, 02 Feb 2010 04:38:06 +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=11199</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[REQUEST: Reference an inplacebutton? :   oleg wrote:yes, maybe :( will...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=56523&amp;title=request-reference-an-inplacebutton#56523</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 11199<br /><strong>Posted:</strong> 02 February 2010 at 4:38am<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by oleg" alt="Originally posted by oleg" style="vertical-align: text-bottom;" /> <strong>oleg wrote:</strong><br /><br />yes, maybe :( will check it.</td></tr></table> <DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Hi Oleg,</DIV><DIV>&nbsp;</DIV><DIV>Did you check this? I tried to dynamically add buttons in SelectionChanged event and it doesn't "refresh" only when selecting item a second time. I tried with .LockRedraw as I mentioned in previous reply but that causes a crash. So there's no option to refresh item on first selection :(</DIV><DIV>&nbsp;</DIV><DIV>Note: I tried with V13.1.0 so maybe old version... But I have to ask you if you checked this already before upgrading <img src="https://forum.codejock.com/smileys/smiley2.gif" border="0"></DIV><DIV>&nbsp;</DIV><DIV>Thanks</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 02 Feb 2010 04:38:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=56523&amp;title=request-reference-an-inplacebutton#56523</guid>
  </item> 
  <item>
   <title><![CDATA[REQUEST: Reference an inplacebutton? : yes, maybe :( will check it. ]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=45566&amp;title=request-reference-an-inplacebutton#45566</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 11199<br /><strong>Posted:</strong> 17 February 2009 at 11:33am<br /><br />yes, maybe :( will check it.]]>
   </description>
   <pubDate>Tue, 17 Feb 2009 11:33:02 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=45566&amp;title=request-reference-an-inplacebutton#45566</guid>
  </item> 
  <item>
   <title><![CDATA[REQUEST: Reference an inplacebutton? : Hi Oleg,  The FindButton method...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=45562&amp;title=request-reference-an-inplacebutton#45562</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 11199<br /><strong>Posted:</strong> 17 February 2009 at 11:01am<br /><br /><DIV>Hi Oleg,</DIV><DIV>&nbsp;</DIV><DIV>The FindButton method is working, thanks for that <img src="https://forum.codejock.com/smileys/smiley2.gif" border="0"></DIV><DIV>&nbsp;</DIV><DIV>But I have a remark:</DIV><DIV>&nbsp;</DIV><DIV>The button doesn't get updated with newly assigned value (Caption, icon, etc...) Only when I use it like this:</DIV><DIV>&nbsp;</DIV><DIV><strong>wndPropertyGrid.LockRedraw = True</strong><BR>wndPropertyGrid.FindItem(ID_PROPGRID_PROJECT).InplaceButtons.FindButton(ID_PROPGRID_BUTTON_COPY).IconIndex = ID_PROPGRID_BUTTON_UPDATE&nbsp;&nbsp;&nbsp; </DIV><DIV><strong>wndPropertyGrid.LockRedraw = False</strong></DIV><DIV><strong></strong>&nbsp;</DIV><DIV>Without LockRedraw the value gets updated&nbsp;until item is selected / resized (I guess internal redraw). </DIV><DIV>&nbsp;</DIV><DIV>Thanks in advance</DIV>]]>
   </description>
   <pubDate>Tue, 17 Feb 2009 11:01:45 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=45562&amp;title=request-reference-an-inplacebutton#45562</guid>
  </item> 
  <item>
   <title><![CDATA[REQUEST: Reference an inplacebutton? : Hi Oleg,  Thanks a lot for adding...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=44115&amp;title=request-reference-an-inplacebutton#44115</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 11199<br /><strong>Posted:</strong> 05 January 2009 at 3:55am<br /><br />Hi Oleg,<DIV>&nbsp;</DIV><DIV>Thanks a lot <img src="https://forum.codejock.com/smileys/smiley4.gif" border="0">&nbsp;for adding this is next release. Could you please look at my other post and just reply with YES / NO or&nbsp;TODO LIST. If you aren't going to add anything at all just say so... at least I know <img src="https://forum.codejock.com/smileys/smiley2.gif" border="0">&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Thanks again</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Mon, 05 Jan 2009 03:55:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=44115&amp;title=request-reference-an-inplacebutton#44115</guid>
  </item> 
  <item>
   <title><![CDATA[REQUEST: Reference an inplacebutton? : Thanks. FindButton added for...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=44106&amp;title=request-reference-an-inplacebutton#44106</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 11199<br /><strong>Posted:</strong> 05 January 2009 at 2:19am<br /><br />Thanks.<DIV>FindButton added for InplaceButtons.</DIV>]]>
   </description>
   <pubDate>Mon, 05 Jan 2009 02:19:04 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=44106&amp;title=request-reference-an-inplacebutton#44106</guid>
  </item> 
  <item>
   <title><![CDATA[REQUEST: Reference an inplacebutton? :   nighthawk wrote:  The PropertyGridItems...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=44085&amp;title=request-reference-an-inplacebutton#44085</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 11199<br /><strong>Posted:</strong> 02 January 2009 at 4:42pm<br /><br /><FONT size=2><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by nighthawk" alt="Originally posted by nighthawk" style="vertical-align: text-bottom;" /> <strong>nighthawk wrote:</strong><br /><br /></FONT><DIV><FONT size=2>&#091;...&#093;</FONT></DIV><DIV><FONT size=2>The PropertyGridItems and InPlaceButtons are both collections that you can loop through to find the button with the correct ID.&nbsp; </FONT></DIV><DIV><FONT size=2>&#091;...&#093;</FONT></DIV><DIV><FONT size=2></td></tr></table> </FONT></DIV><DIV><FONT size=2>&nbsp;</FONT></DIV><DIV><FONT size=2>Hi Nighthawk,</FONT></DIV><DIV><FONT size=2>&nbsp;</FONT></DIV><DIV><FONT size=2>Thanks for reply, I know you can loop&nbsp;through items and buttons. If you don't know the exact item and want to loop the propertygrid items in entire Category and there are <strong>multi level items</strong> you have to create loop for every child <img src="https://forum.codejock.com/smileys/smiley5.gif" border="0">&nbsp;The reason I did the post and added <strong>RETRY</strong> to post description is to have Oleg look at the issue again and maybe, just maybe he would add feature to reference button with ID and NOT with Index. It is strange we can loop through collection and retrieve ID, InplaceButton event is also returning ID, the only thing we can't is to reference the button directly <img src="https://forum.codejock.com/smileys/smiley5.gif" border="0">&nbsp;(with ID)</FONT></DIV><DIV><FONT size=2>&nbsp;</FONT></DIV><DIV><FONT size=2>Thanks anyway <img src="https://forum.codejock.com/smileys/smiley2.gif" border="0">&nbsp;Now I know I'm not alone waiting for improvement with this... </FONT></DIV><DIV><FONT size=2>&nbsp;</FONT></DIV><DIV><FONT size=2>Thank you</FONT></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 02 Jan 2009 16:42:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=44085&amp;title=request-reference-an-inplacebutton#44085</guid>
  </item> 
  <item>
   <title><![CDATA[REQUEST: Reference an inplacebutton? : The PropertyGridItems and InPlaceButtons...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=44081&amp;title=request-reference-an-inplacebutton#44081</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=570">nighthawk</a><br /><strong>Subject:</strong> 11199<br /><strong>Posted:</strong> 02 January 2009 at 1:22pm<br /><br />The PropertyGridItems and InPlaceButtons are both collections that you can loop through to find the button with the correct ID.&nbsp; You can use a&nbsp; function like:<br><br>Private Function getInPlaceButton(p_objPG As XtremePropertyGrid.PropertyGrid, p_lngButtonID As Long) As XtremePropertyGrid.PropertyGridInplaceButton<br>&nbsp;&nbsp;&nbsp; Dim objItem As XtremePropertyGrid.PropertyGridItem<br>&nbsp;&nbsp;&nbsp; Dim objButton As XtremePropertyGrid.PropertyGridInplaceButton<br>&nbsp;&nbsp;&nbsp; Dim objFoundButton As XtremePropertyGrid.PropertyGridInplaceButton<br><br>&nbsp;&nbsp;&nbsp; On Error GoTo getInPlaceButton_Error<br><br>&nbsp;&nbsp;&nbsp; 'loop through all propertygriditems in propertygrid<br>&nbsp;&nbsp;&nbsp; For Each objItem In p_objPG.Categories<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'loop through all inplacebuttons in propertygriditem<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For Each objButton In objItem.InplaceButtons<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'if matching buttonid is found, return inplacebutton and break loops<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (objButton.Id = p_lngButtonID) Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set objFoundButton = objButton<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit For<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'break category loop if button was found<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (Not (objFoundButton Is Nothing)) Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit For<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br>&nbsp;&nbsp;&nbsp; Next<br><br>&nbsp;&nbsp;&nbsp; Set objItem = Nothing<br>&nbsp;&nbsp;&nbsp; Set objButton = Nothing<br>&nbsp;&nbsp;&nbsp; Set getInPlaceButton = objFoundButton<br><br>&nbsp;&nbsp;&nbsp; On Error GoTo 0<br>&nbsp;&nbsp;&nbsp; Exit Function<br><br>getInPlaceButton_Error:<br>End Function<br><br><br><br>This will give you access to the button with the specific ID.&nbsp; You can then access the Index property to do you delete.&nbsp; Replace your delete event in your sample project with:<br><br>Private Sub Command1_Click()<br>&nbsp;&nbsp;&nbsp; wndPropertyGrid.FindItem("Item").InplaceButtons.Remove getInPlaceButton(wndPropertyGrid, 520).index + 1<br>&nbsp;&nbsp;&nbsp; wndPropertyGrid.FindItem("Item").Selected = True<br>End Sub<br><br><br><br>For some reason, a button reports its own index as 1 off compared to the index of the collection, that is the reason for the "+ 1".&nbsp; This delete will generate an error if the button id doesn't exist.&nbsp; You will want to check for that. You can also optimize the getInPlaceButton() code if you already know or have access to the appropriate PropertyGridItem record.<br>]]>
   </description>
   <pubDate>Fri, 02 Jan 2009 13:22:22 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=44081&amp;title=request-reference-an-inplacebutton#44081</guid>
  </item> 
  <item>
   <title><![CDATA[REQUEST: Reference an inplacebutton? : Hi Oleg,  I thought I give another...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=44074&amp;title=request-reference-an-inplacebutton#44074</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 11199<br /><strong>Posted:</strong> 02 January 2009 at 7:39am<br /><br />Hi Oleg,<DIV>&nbsp;</DIV><DIV>I thought I give another try... Everyone has started&nbsp;a fresh year <img src="https://forum.codejock.com/smileys/smiley2.gif" border="0">&nbsp;so...</DIV><DIV>&nbsp;</DIV><DIV>This test project is to make a point regarding&nbsp;referencing of inplacebuttons by it's index. I would like to see that the ID is used to reference the inplacebutton. With removing a button, I have to know&nbsp;where the button is located <img src="https://forum.codejock.com/smileys/smiley5.gif" border="0"></DIV><DIV>&nbsp;</DIV><DIV>Could you please do something about this?</DIV><DIV>&nbsp;</DIV><DIV>Thanks a lot&nbsp;</DIV><DIV>&nbsp;</DIV><DIV><a href="https://forum.codejock.com/uploads/20090102_073902_Test_PropertyIn.zip" target="_blank">uploads/20090102_073902_Test_PropertyIn.zip</A></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 02 Jan 2009 07:39:56 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=44074&amp;title=request-reference-an-inplacebutton#44074</guid>
  </item> 
  <item>
   <title><![CDATA[REQUEST: Reference an inplacebutton? : Hi,   When dynamically adding...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=38285&amp;title=request-reference-an-inplacebutton#38285</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 11199<br /><strong>Posted:</strong> 13 July 2008 at 2:07am<br /><br />Hi,<DIV>&nbsp;</DIV><OL><LI>When dynamically adding buttons you don't know it's index (it could, but I don't want to keep record of what buttons are added and on which location). </LI><LI>If you change the position of the button (when adding the button) you have change the code in all events as well. I do a lot of changes before I'm satisfied how it looks <img src="https://forum.codejock.com/smileys/smiley2.gif" border="0"></LI></OL><DIV>So using the index will not be the best approach for me.</DIV><DIV>&nbsp;</DIV><DIV>Thanks</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Sun, 13 Jul 2008 02:07:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=38285&amp;title=request-reference-an-inplacebutton#38285</guid>
  </item> 
  <item>
   <title><![CDATA[REQUEST: Reference an inplacebutton? : Hi,  Why you need another way....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=38101&amp;title=request-reference-an-inplacebutton#38101</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 11199<br /><strong>Posted:</strong> 10 July 2008 at 5:37am<br /><br /><DIV>Hi,</DIV><DIV>&nbsp;</DIV><DIV>Why you need another way. It was right way :) Just use its Index:</DIV><DIV>&nbsp;</DIV><DIV>Item.InplaceButtons(<strong>1</strong>).Enabled = Item.Value &gt; 0</DIV>]]>
   </description>
   <pubDate>Thu, 10 Jul 2008 05:37:04 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11199&amp;PID=38101&amp;title=request-reference-an-inplacebutton#38101</guid>
  </item> 
 </channel>
</rss>