Event handler crash

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • poko
    New Member
    • Dec 2009
    • 16

    Event handler crash

    I have 3 textboxes on my form, TB1, TB2 and TB3.

    TB1 & TB2 are constantly being updated with new data as fast as it is received.

    TB3 is used to show the difference between TB1 & TB2. I convert the text from both TB1 & TB2 to double, perform the subtraction, and then convert the result back to string and display it in TB3.

    The problem is that the subtraction works only if either TB1 or TB2 holds constant data, i.e. not changing. If both of them are changing and displaying new data, the code crashes giving me an event handler error.

    Can anyone please guide me as to what could the error be?
  • GaryTexmo
    Recognized Expert Top Contributor
    • Jul 2009
    • 1501

    #2
    Can you post more details as to what the error is? There's not much to go on here.

    How are your events set up? Is there ever a chance anything can go wrong, like maybe a divide by zero or something that can't be converted to a double? How are you converting to double... are you just casting the string, or are you using double.TryParse ?

    I hope those questions give you some things to think about. A more detailed description of the error would definitely help though :)

    Comment

    • poko
      New Member
      • Dec 2009
      • 16

      #3
      Oh I sorted it out. It was a rather silly mistake. Thanks for the reply tho...

      Comment

      Working...