Clearing a Decimal

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shanehenery
    New Member
    • Feb 2010
    • 24

    #1

    Clearing a Decimal

    Hi
    I have a problem in my vb coding the code is
    Code:
    TitleTextBox.Clear()
            PriceTextBox.Clear()
            ExtendedPriceTextBox.clear()
            DiscountedPriceTextBox.Clear()
            With QuantityTextBox
                .Clear()
                .Focus()
    I have declared the 'ExtendedPriceT extBox' as a Decimal
    but now it gives me a other error 'clear' is not a member of 'Decimal'.
    how do I fix this
    if I change the code it gives me a different error

    can you pleas help me
    Last edited by Frinavale; Apr 13 '10, 03:05 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    A Decimal type is a number.
    It does not have a method or property named "Clear".
    To "clear" this I think you would probably just want to set the Decimal to 0 (or maybe -1 or something depending on your requirements).

    For Example:
    Code:
    ExtendedPriceTextBox=0
    What is very confusing about this is that you you have included "TextBox" into the name of a Decimal type. You should avoid putting type descriptions into variable names because (as you can see) it can be confusing and misleading. A better name would have been simply "ExtendedPrice" .

    When you have a new question please post it in it's own thread.
    I have split this question off of your other question:VB.NET Installation Problem.


    -Frinny

    Comment

    Working...