Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3785514
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:32:25+00:00 2026-05-19T11:32:25+00:00

Feels like bugs and problems are attracted to me lately! =P So I finally

  • 0

Feels like bugs and problems are attracted to me lately! =P

So I finally took some time off today to explore a little Rx.

Heres what I did:

alt text

Here’s the only piece of running code:

 private void button1_Click(object sender, EventArgs e)
 {
       var txtc = Observable.FromEvent<EventArgs>(textBox1, "TextChanged")
                 .Throttle(TimeSpan.FromSeconds(0.5))
                 .SubscribeOnDispatcher();//**also tried .SubscribeOn(this)
       var t = from x in txtc select textBox1.Text;
       t.Subscribe(x => listBox1.Items.Add(x));
 }

Now, when run Debug (F5) I click the Button, all good, I then type something, poof! The form just silently dies!!

If I run without debugging, the application runs flawlessly!

Note: I removed the code from the Form.Load event because of the known bug with VS not breaking on exceptions in that event on Win7x64 (and yes thats my machine)

This is what the debug output looks like:

The thread ‘vshost.NotifyLoad’ (0x1438) has exited with code 0 (0x0).

The thread ‘vshost.LoadReference’ (0x155c) has exited with code 0 (0x0).

‘RxWinForms.vshost.exe’ (Managed (v4.0.30319)): Loaded ‘\RxWinForms\bin\Debug\RxWinForms.exe’, Symbols loaded.

A first chance exception of type ‘System.InvalidOperationException’ occurred in System.Windows.Forms.dll

The program ‘[5228] RxWinForms.vshost.exe: Managed (v4.0.30319)’ has exited with code 0 (0x0).

The program ‘[5228] RxWinForms.vshost.exe: Program Trace’ has exited with code 0 (0x0).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:32:25+00:00Added an answer on May 19, 2026 at 11:32 am

    You need to make sure that either the Throttling is happening on the current dispatcher or that you switch back on to the current dispatcher through ObserveOn (not SubscribeOn) before you try and change the UI (I believe that by default Throttling is done on the TaskPool).

    So both of the solutions below work:

    private void button1_Click(object sender, EventArgs e)
    {
        txtc = Observable.FromEvent<EventArgs>(textBox1, "TextChanged")
           .Throttle(TimeSpan.FromSeconds(0.5))
           .ObserveOn(Scheduler.Dispatcher);
    
        var t = from x in txtc 
                select textBox1.Text;
    
        t.Subscribe(x => listBox1.Items.Add(x));
    }
    

    and

    private void button1_Click(object sender, EventArgs e)
    {
       txtc = Observable.FromEvent<EventArgs>(textBox1, "TextChanged")
          .Throttle(TimeSpan.FromSeconds(0.5), Scheduler.Dispatcher)
    
       var t = from x in txtc 
               select textBox1.Text;
    
       t.Subscribe(x => listBox1.Items.Add(x));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It feels like there must be some semi-simple solution to this, but I just
ffmpeg feels like its taking a long time. I then look at my output
I'm getting a little tired of building web applications. Feels like same thing over
This feels like a super newb question, so apologizes in advance. How does one
This feels like a really basic question, but I can't figure it out anyway..
This feels like it should be pretty simple, but not much seems to be
This feels like the kind of code that only fails in-situ, but I will
OK, this feels like an idiot question, but I'm stuck - I don't know
Earlier this week, I had to do something which feels like a semantics violation.
Another one I can't find an answer for, and it feels like I've gone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.