|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Backgroundworker to populate a TreeViewI 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 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 Show quoteHide quote "Dave Wurtz" <dave_wu***@asdsoftware.com> wrote in message news:1139431586.301259.51640@f14g2000cwb.googlegroups.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 > 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_developers.htm#AsynchronousOperations -- Show quoteHide quoteBest 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" <dave_wu***@asdsoftware.com> escribió en el mensaje news:1139431586.301259.51640@f14g2000cwb.googlegroups.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 >
IsNumeric Bug or misunderstanding?
Are people using data binding now? Accessing embedded resources what's the difference Function parameter function sorting inherited BindingList problem with localization Simple but difficult to find solution for loading HTML into object Help referencing a variable in HTML of an aspx page Strange behavior data-bound combobox |
|||||||||||||||||||||||