Print Page | Close Window

DefaultValue PropertyGridItemColor

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


Topic: DefaultValue PropertyGridItemColor
Posted By: Aaron
Subject: DefaultValue PropertyGridItemColor
Date Posted: 11 May 2009 at 8:25am
Hi,
 
I'm trying to set Item.DefaultValue of PropertyGridItemColor to same value as Item.Value
But it's not working so well...
 
This is what I do:
 
Load settings of PropertyGrid items from XML file. After loading the settings I would like to set the .DefaultValue the same as .Value because it looks like properties has been changed (I have HighLightChangedItems = True).
 
This doesn't work: Item.DefaultValue = Item.Value
 
How can I get this to work?
 
Thanks a lot in advance
 
 


-------------
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....



Replies:
Posted By: SuperMario
Date Posted: 11 May 2009 at 1:51pm
    Dim ColorItem As PropertyGridItemColor
    Set ColorItem = Category.AddChildItem(PropertyItemColor, "ColorItem", RGB(10, 20, 30))
    
    'change color to something else
    ColorItem.Value = RGB(255, 204, 0)
    ColorItem.EditorStyle = ItemColorPopup
   
    Dim lRed As Long
    Dim lGreen As Long
    Dim lBlue As Long
   
    lRed = ColorItem.Value And 255
    lGreen = (ColorItem.Value \ 256) And 255
    lBlue = (ColorItem.Value \ 65536) And 255
   
    ColorItem.DefaultValue = lRed & "; " & lGreen & "; " & lBlue


Posted By: Aaron
Date Posted: 11 May 2009 at 2:19pm
Hi,
 
This will do for now. Would be nice if (in near future) something would change with DefaultValue <> Value types. I'm having some problems with this but I will open ticket for this and maybe it will be solved somehow
 
Thank you
 
  


-------------
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: SuperMario
Date Posted: 11 May 2009 at 2:39pm
I'll notify Oleg when the issue comes in. 



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