Reputation: 1534
Consider this scenario: I have two forms (Form1 and Form2). When a button is clicked in Form1, it loads Form2. Form2 contains gridcontrol to show some data. Since the data is large, Form2 takes some time to load. That freezes the whole application.
I would like to access Form1 while Form2 is loading. Is it possible?
Upvotes: 1
Views: 968
Reputation: 30840
Look at this answer for Loading data from DB asynchronously in win forms
.
You will have to load data asynchronously to allow form2's UI responsive.
Now to access Form1 from Form2, you could:
Upvotes: 0
Reputation: 1039498
You could use a BackgroundWorker to load the data in a separate thread to avoid blocking the main thread.
Upvotes: 3