467,889 Members | 1,399 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,889 developers. It's quick & easy.

Backgroundworker to populate a TreeView

All,

I have a treeview on my form that has a lot of nodes on it. I would
like to populate this treeview on another thread so my form will still
paint while it is being populated.

I have looked at the Backgroundworker object (and dragged one onto my
form) and several other newsgroup threads. What I don't understand is
that I can't access the treeview control in the sub that is handling
the DoWork event (I get the error that I can't access a control that
was created on a different thread.). How do I add my nodes to the
control if it is on a different thread. I'm probably missing something
obvious here!

Please help!

Thanks in advance!

Dave Wurtz
Advanced Software Designs

Feb 8 '06 #1
  • viewed: 3643
Share:
2 Replies
if you are on .NET 2.0 why not just use a virtual list view? it would let
you have virtualy unlimited number of nodes show up instantly

"Dave Wurtz" <da********@asdsoftware.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
All,

I have a treeview on my form that has a lot of nodes on it. I would
like to populate this treeview on another thread so my form will still
paint while it is being populated.

I have looked at the Backgroundworker object (and dragged one onto my
form) and several other newsgroup threads. What I don't understand is
that I can't access the treeview control in the sub that is handling
the DoWork event (I get the error that I can't access a control that
was created on a different thread.). How do I add my nodes to the
control if it is on a different thread. I'm probably missing something
obvious here!

Please help!

Thanks in advance!

Dave Wurtz
Advanced Software Designs

Feb 8 '06 #2
Hi Dave,

Before looking at the Backgroundworker class of .NET 2.0, take a look at the
basics and once you understand it you can take advantage of that class of
..NET 2.0:

Resources about asynchronous operations
http://www.mztools.com/resources_net...nousOperations

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Dave Wurtz" <da********@asdsoftware.com> escribió en el mensaje
news:11*********************@f14g2000cwb.googlegro ups.com...
All,

I have a treeview on my form that has a lot of nodes on it. I would
like to populate this treeview on another thread so my form will still
paint while it is being populated.

I have looked at the Backgroundworker object (and dragged one onto my
form) and several other newsgroup threads. What I don't understand is
that I can't access the treeview control in the sub that is handling
the DoWork event (I get the error that I can't access a control that
was created on a different thread.). How do I add my nodes to the
control if it is on a different thread. I'm probably missing something
obvious here!

Please help!

Thanks in advance!

Dave Wurtz
Advanced Software Designs

Feb 9 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by T.H.M | last post: by
4 posts views Thread by Mike | last post: by
9 posts views Thread by Marina | last post: by
6 posts views Thread by Beginner | last post: by
11 posts views Thread by Jamie Bissett | last post: by
reply views Thread by Patrick | last post: by
13 posts views Thread by Johnny Jörgensen | last post: by
reply views Thread by xmail123 | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.