in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Deleting Text from C1NumericEdit

Last post 04-29-2008 3:31 AM by C1_JohnAd. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-23-2008 7:26 PM

    Deleting Text from C1NumericEdit

     When I delete text from a C1NumericEdit, I seem to only have 2 options.  Either I delete the text (0.90) and the value just reappears or I end up with nothing (if I set EmptyAsNull property to true).  If the Custom format on the textbox is set to textbox.CustomFormat = "########0.00";, I would expect to see 0.00 in the textbox if I delete or backspace over the text and then leave the control.  How can I do this?  It would seem to make sense that there should be a property for this on the control since I could see more developers than not, wanting to do this at some point...but I cannot find it???

    Thanks. 

  • 04-24-2008 5:04 PM In reply to

    Re: Deleting Text from C1NumericEdit

    HELLLOOOOOOO!!!!! Is anyone at C1 monitoring and answering questions today?  A robust sample using the C1NumericEdit would be helpful...especially if it does what I am asking above.

    Thanks. 

  • 04-29-2008 3:31 AM In reply to

    Re: Deleting Text from C1NumericEdit

    Hello,
     
    You may try the following code snippet.
     
    BEGIN CODE

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Me.C1NumericEdit1.FormatType = C1.Win.C1Input.FormatTypeEnum.CustomFormat

    Me.C1NumericEdit1.CustomFormat = "#,##0.00"

    Me.C1NumericEdit1.EmptyAsNull = True  ' Important to be added

    End Sub

    Private Sub C1NumericEdit1_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles C1NumericEdit1.ValueChanged

          If Me.C1NumericEdit1.Value Is DBNull.Value Then

                Me.C1NumericEdit1.Value = 0

          End If

    End Sub

    END CODE

     
    I hope this will help you.
     
    Regards,
     
    Allen Smith
    <brent.podruzny> wrote in message news:204255@10.0.1.98...

    HELLLOOOOOOO!!!!! Is anyone at C1 monitoring and answering questions today?  A robust sample using the C1NumericEdit would be helpful...especially if it does what I am asking above.

    Thanks. 



    http://helpcentral.componentone.com/cs/forums/p/75057/204255.aspx#204255

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.