Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Property Grid
  New Posts New Posts RSS Feed - Inplacebutton for readonly properties
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Inplacebutton for readonly properties

 Post Reply Post Reply
Author
Message
dimdar View Drop Down
Groupie
Groupie
Avatar

Joined: 11 July 2007
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote dimdar Quote  Post ReplyReply Direct Link To This Post Topic: Inplacebutton for readonly properties
    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\; \\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?
 
 
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
dimdar View Drop Down
Groupie
Groupie
Avatar

Joined: 11 July 2007
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote dimdar Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
dimdar View Drop Down
Groupie
Groupie
Avatar

Joined: 11 July 2007
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote dimdar Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.