Print Page | Close Window

Inplacebutton for readonly properties

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=14337
Printed Date: 23 November 2024 at 7:11am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Inplacebutton for readonly properties
Posted By: dimdar
Subject: Inplacebutton for readonly properties
Date Posted: 19 May 2009 at 10:53am
Hi,
 
I use the property control for display many properties that are not changeable by users and many property display a directory path like C:\windows; c:\documents\data\; file://\\serv2\users - \\serv2\users , etc. I need to put a button for open the path on explorer without do a copy and paste of it, so, I have added a button that open the folder with shell command but the buttons are not show if readonly property i set on true. I can I do it?
 
 



Replies:
Posted By: Aaron
Date Posted: 19 May 2009 at 12:58pm
Hi,
 
You can enable/disble inplacebutton directly:
 
Set propItem = Item.AddChildItem(PropertyItemString, "PropertyItemString", "abc")
      propItem.InplaceButtons.Add 1
      
      propItem.InplaceButtons(1).Enabled = False
     
 
Or 
 
With V13.0:
 
wndPropertyGrid.FindItem(ID_PROPGRIDITEM).InplaceButtons.FindButton(ID_INPLACEBUTTON).Enabled = False (or True)  
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: dimdar
Date Posted: 20 May 2009 at 3:37am
Originally posted by Aaron Aaron wrote:

Hi,
 
You can enable/disble inplacebutton directly:
 
Set propItem = Item.AddChildItem(PropertyItemString, "PropertyItemString", "abc")
      propItem.InplaceButtons.Add 1
      
      propItem.InplaceButtons(1).Enabled = False
     
 
Or 
 
With V13.0:
 
wndPropertyGrid.FindItem(ID_PROPGRIDITEM).InplaceButtons.FindButton(ID_INPLACEBUTTON).Enabled = False (or True)  
 
 
 
 
Hi,
 
Already done but the button is missing and not visible and disabled. When property is readonly the InplaceButtons are not draw.
 
Try this:
 
Set propItem = Item.AddChildItem(PropertyItemString, "PropertyItemString", "abc")
      propItem.ReadOnly = True
      propItem.InplaceButtons.Add 1
      
      propItem.InplaceButtons(1).Enabled = True


Posted By: Aaron
Date Posted: 20 May 2009 at 4:36am
Hi,
 
You can try this instead:
 
Set propItem = Item.AddChildItem(PropertyItemString, "PropertyItemString", "abc")
       propItem.ReadOnly = True
       propItem.Flags = 0
       propItem.InplaceButtons.Add 1
       propItem.InplaceButtons(1).Enabled = True
       propItem.CaptionMetrics.ForeColor = vbGrayed  'Now it looks the same as ReadOnly = true
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: dimdar
Date Posted: 20 May 2009 at 4:47am
Hi,
 
It seem to work but with Item.Flags = 0 I lost the possibility to do copy of the property value.


Posted By: Aaron
Date Posted: 20 May 2009 at 7:33am
Hi,
 
You can't have it all
 
I'm not fond of rightclick standard popup menu anyway so... You can add own popup menu and add copy / paste functions yourself but that's your choise.
 
 
 
  


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net