Print Page | Close Window

Feature suggestion

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=3670
Printed Date: 27 November 2024 at 6:01am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Feature suggestion
Posted By: TimStowe
Subject: Feature suggestion
Date Posted: 17 February 2006 at 10:30am
It'd be very useful to be able to lock a property grid item but still be able to use the buttons - sort of a variation on read only.  This way, the user is forced to use the color picker, rather than manually enter the color code (and possibly screw it up).



Replies:
Posted By: gshawn
Date Posted: 17 February 2006 at 10:43am
cool... I would also be able to use this feature :)


Posted By: Oleg
Date Posted: 20 February 2006 at 10:44am

Hello,

just don't set ItemHasEdit flag:

Set Item = Category.AddChildItem(PropertyItemColor, "ToolbarColor", &HAA00FF)
Item.Flags = ItemHasComboButton



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: TimStowe
Date Posted: 22 February 2006 at 7:20am
Oleg,

I've done that, and it still allows editing in the item. 


Posted By: Oleg
Date Posted: 23 February 2006 at 8:01am

Hello,

Show your code. it must work.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: TimStowe
Date Posted: 23 February 2006 at 8:14am
Oleg, this code allows the user to type into that field.  Whatever they add to that field disappears as soon as the field loses focus, but they can still type there.




  Dim pgiColorDesc As PropertyGridItem
  Dim pgiColorItem As PropertyGridItem
 
  On Error GoTo ErrorHandler

  Set pgiColorDesc = pgiCategory.AddChildItem(PropertyItemString, sParentCaption)
  pgiColorDesc.ReadOnly = True
  Set pgiColorItem = pgiColorDesc.AddChildItem(PropertyItemColor, lblBackColor.Caption)
  pgiColorItem.Value = lBackColor
  Set pgiColorItem = pgiColorDesc.AddChildItem(PropertyItemColor, lblForeColor.Caption)
  pgiColorItem.Value = lForeColor
  pgiColorItem.flags = ItemHasComboButton
  pgiColorDesc.CaptionMetrics.BackColor = lBackColor
  pgiColorDesc.CaptionMetrics.ForeColor = lForeColor
  pgiColorItem.EnsureVisible




 


Posted By: TimStowe
Date Posted: 23 February 2006 at 9:44am
Wait a minute...  I'm a moron.  Just figured it out.

Disregard that previous code snippet.



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