Hi,
I need a PropertyGridSpinEditor with a small difference, it must always show 2 digit. Example: "00", "03", "14"..
You can see in the image, i have achieved only when the edition has ended with this code.
Private Sub PropertyGridParams_ItemFormatting(sender As Object, e As UI.PropertyGridItemFormattingEventArgs) Handles PropertyGridParams.ItemFormatting If (e.Item.Name = NameOf(PROPNAME)) Then DirectCast(e.VisualElement, PropertyGridItemElement).ValueElement.Text = PROP.ToString("00") End IfEnd Sub
I try it, but doesnt work.
Public Class NumericUpDownEditor Inherits PropertyGridSpinEditor Public Overrides Sub OnValueChanged() If (Me.Value.ToString.Length < 2 AndAlso IsNumeric(Me.Value)) Then Me.Value = Integer.Parse(Me.Value.ToString()).ToString("00") Else MyBase.OnValueChanged() End If End SubEnd Class
Is there any way to achieve that?
Thank you!