SOLVED: Show Yes,No not True,False in Item |
Post Reply |
Author | |
mstuart
Groupie Joined: 06 April 2010 Location: United States Status: Offline Points: 36 |
Post Options
Thanks(0)
Posted: 13 April 2010 at 7:13pm |
Hi all,
How do I "swap" out the default True,False for Yes,No in the Constraints for a PropertyItemBool type Item? I've added the constraints, but the result is 4 options: True,False,Yes,No. I know I could probably make the Item a PropertyItemString, but the Data wouldn't be boolean True/False. |
|
Regards,
Mark Stuart Product: Xtreme SuitePro (ActiveX) v13.2.1 Platform: WinXP (32bit)/Win7 (64bit) Language: VB6 (SP6), Magic eDeveloper v9.4, uniPaaS v1.9 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
To get rid of the True & False constraints just call Item.Constraints.Remove before adding constraints "Yes" & "No"
Or
The propertyGridItemBool actually has 2 constraints already so you could:
Dim Item As PropertyGridItem
Set Item = Category.AddChildItem(PropertyItemBool, "Bool", 0) Item.Constraints(1).Caption = "Yes" Item.Constraints(2).Caption = "No" but you aren't able to select Yes I would expect this to work but it doesn't
Better use Enum instead but then again you have to check value in ValueChanged event.
Dim Item As PropertyGridItem
Set Item = Category.AddChildItem(PropertyItemEnum, "Enum", "") Item.Constraints.Add "Yes", True 'for readability actual value = -1 Item.Constraints.Add "No", False 'for readability actual value = 0 Item.Flags = 0 'Only allow selection with arrow
Item.Id = PROPITEM_ENUM
Private Sub wndPropertyGridFiles_ValueChanged(ByVal Item As XtremePropertyGrid.IPropertyGridItem)
Select case Item.Id
Case PROPITEM_ENUM
Debug.Print CBool(Item.Value)
End Select
End Sub
Hope this helps
|
|
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.... |
|
mstuart
Groupie Joined: 06 April 2010 Location: United States Status: Offline Points: 36 |
Post Options
Thanks(0)
|
Hi Aaron,
I've taken the easier path by using a string item and using "Yes","No". I then check the PropertyGrid_ValueChanged() event to do what I need to do. |
|
Regards,
Mark Stuart Product: Xtreme SuitePro (ActiveX) v13.2.1 Platform: WinXP (32bit)/Win7 (64bit) Language: VB6 (SP6), Magic eDeveloper v9.4, uniPaaS v1.9 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |