Format not immediate |
Post Reply |
Author | |
bluelizard
Newbie Joined: 24 March 2005 Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: 24 March 2005 at 3:59pm |
When you change the numeric format of PropertyGridItem using Format
function, the change is not immediately applied to the number (type
Double). If you edit the value or set the value after code, then
the format is applied. Should be applied when Format string
changes too.
To duplicate in VB6, place PropertyGrid on Form1 and add the Form_Load code. Private Sub Form_Load() Dim pi As Double pi = Atn(1) * 4 Dim fmt As String fmt = "%0.9f" Dim pgiCat As PropertyGridItem Set pgiCat = PropertyGrid1.AddCategory("Category") pgiCat.Expanded = True Dim pgiChild As PropertyGridItem Set pgiChild = pgiCat.AddChildItem(PropertyItemDouble, "Child", pi) pgiChild.Format = fmt 'this doesn't display right away Dim pgiNext As PropertyGridItem Set pgiNext = pgiCat.AddChildItem(PropertyItemDouble, "Next", Null) pgiNext.Value = pi pgiNext.Format = fmt 'this doesn't display right either Dim pgiSibling As PropertyGridItem Set pgiSibling = pgiCat.AddChildItem(PropertyItemDouble, "Sibling", 0) pgiSibling.Format = fmt pgiSibling.Value = pi 'this displays correctly. End Sub |
|
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 |