Re: threading & suspendlayout
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 05/27/04
- Next message: Jon Skeet [C# MVP]: "Re: type case"
- Previous message: LeeHACK[Jhin-Seok.Lee]: "Re: problems intallation VS.Net"
- In reply to: 2G: "threading & suspendlayout"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 27 May 2004 09:32:18 +0100
2G <2G@pandora.be> wrote:
> I've a usercontrol that fills a listview with data from my db, I had
> this.SuspendLayout() in the beginning and this.ResumeLayout at the end of
> the function that loads the data and all worked fine. But now that I have
> threaded the function (refreshdata), the SuspendLayout and ResumeLayout()
> doesn't work any more, I tried solving it with Invoke() but with no succes.
> public UserControl1(){
>
> this.SuspendPaint += new DSuspendPaint(this.SuspendPaintProc);
> }
You're using Invoke for the SuspendLayout and ResumeLayout calls, but
it looks like you're still filling the listview from your worker
thread, which you shouldn't be. *Everything* which touches the UI
should be done from the UI thread.
I'm not sure why you've got a SuspendPaint event, either...
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: Jon Skeet [C# MVP]: "Re: type case"
- Previous message: LeeHACK[Jhin-Seok.Lee]: "Re: problems intallation VS.Net"
- In reply to: 2G: "threading & suspendlayout"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|