Print Page | Close Window

Data property of selected constraint

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


Topic: Data property of selected constraint
Posted By: TimStowe
Subject: Data property of selected constraint
Date Posted: 15 December 2005 at 9:13am
If I have added a contstraint to an item with the data property set, and I want to later retrieve the data value for the selected constraint, how do I do it?

is it item.constraints.something?

or does some property of the item changes when the constraint is chosen?

or do I have to go through and compare the item's constraints with it's current value, and get the index that way? 



Replies:
Posted By: Oleg
Date Posted: 16 December 2005 at 4:22am

Best way is to use PropertyItemEnum type of items.

See our Sample

    Set ItemEnum = Category.AddChildItem(PropertyItemEnum, "Enum", 2)
   
    'Adds some constraints along with a Data value
    ItemEnum.Constraints.Add "Windows 98", 1
    ItemEnum.Constraints.Add "Windows 2000", 2
    ItemEnum.Constraints.Add "Windows XP", 3

In this case ItemEnum.Value equal Selected constraint.



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


Posted By: jcollier
Date Posted: 20 March 2006 at 1:35pm
When using this method, it seems the value returned by ItemEnum.Value would be "Windows 2000".  How do you retrieve the value "2" when a user would select "Windows 2000" from the dropdown?

I'm using 9.81 ActiveX with VB6


Posted By: jcollier
Date Posted: 20 March 2006 at 1:44pm
Nope.  My mistake.  When using PropertyItemEnum value returns the Data value.  I should have paid more attention.



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