Threading Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Monuindia2002
    New Member
    • Mar 2006
    • 2

    Threading Problem

    I have a text box and a crystal report viewer in a windows form.

    As user types in some text in text box, it should immediately display in report viewer. I have done this, but I have problem here, that is "If user types too quickly then refreshing of the preview screen is fine, but if user type slowly then text is lost"

    I am not able to find a solution to this problem.

    I tried with multithreading, with timer but could not able to implement it.

    can someone please help me in this?

    Thanks in advance
  • semomaniz
    Recognized Expert New Member
    • Oct 2007
    • 210

    #2
    Where is the code that you have written?

    Comment

    • jkmyoung
      Recognized Expert Top Contributor
      • Mar 2006
      • 2057

      #3
      "if user type slowly then text is lost"
      Are you referring to the text inside the textbox? eg, if you type in abcd then e really slowly, does the keystroke of e wipe out abcd?

      If you have an update thread running, when a keystroke comes in, halt the execution of any current update thread and run a new one instead.

      Comment

      • Monuindia2002
        New Member
        • Mar 2006
        • 2

        #4
        Hi,
        Thanks for the reply.

        I have tried the code in text changed event, key up/down events of text box.

        I have tried to do what 'jkmyoung' has suggested, but getting an exception "InvalidOperati onException: Cross-thread operation not valid: Control 'TextBox1' accessed from a thread other than the thread it was created on"

        Can you please suggest something on this?
        Thanks

        Comment

        • jkmyoung
          Recognized Expert Top Contributor
          • Mar 2006
          • 2057

          #5
          I think we need to see code at this point. Try to post only the relevant parts, and use [ code ] code tags [ / code] (without spaces) to get your question answered faster.

          Comment

          Working...