BeginInvoke activates form
I have a WinForms application written in C#. The first screen to appear when it opens is a dashboard screen that can take some ti开发者_如何学Gome to load. The data loading method is called using BeginInvoke on delegate. That part is fine, my problem is when I want to load the read data into some grids. The code to get me back to my UI thread looks like so
BeginInvoke(new Action<DashboardDataInfo, int>(LoadDashboardData), data, outbox);
This all happens without error. My problem is the dashboard Form will jump to the top of the screen. If data loading has taken long enough the user could be already onto another from in the app (so this is really annoying). The LoadDashboardData method doesn't do much besides assign the DataSource property of a few DataGridView controls.
精彩评论