473,395 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Cant set "Treeview.SelectedNode" from different thread

Hi,

I'm current having a problem with the treeview control and multi
threading. The treeview is on a form. A request is then sent to a
server using IP for the data. The data arrives in an event on a
different thread. I have used delegates to allow me to add to the
treeview and it all works fine. I cant however seem to set the
"SelectedNode" property or the treeview. I have tried directly and
also using a delegate. I all cases, the UI freezes for a while, then
the thread times out.

Below is a snippet of the code I have already. Does anyone have any
ideas? Any help is very much appreciated. In the
"SelectTreeviewRootNode" call, I have tried using the passed in
treeview, and the actual name of the one on the form, but neither
works.

Delegate Sub TreeViewSelectRootNodeDelegate(ByVal trvTreeview
As TreeView)

Private mdgtSelectRootNode As New
TreeViewSelectRootNodeDelegate(AddressOf SelectTreeviewRootNode)

Private Sub SelectTreeviewRootNode( _
ByVal trvTreeview As TreeView)

tvwMain.SelectedNode = tvwMain.Nodes(0)
End Sub

tvwMain.Invoke(mdgtSelectRootNode, New Object() {tvwMain})

Cheers

Bobby Owens
Bo*********@ntlworld.com
Nov 21 '05 #1
0 1302

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: feel | last post by:
Goin' crazy with this recursive function ported from delphi... I send a string like DirA/ DirB /DirC but i get in the treeView each one in a new node.Cant get the child node....!! -DirA -DirB...
4
by: Tim Geiges | last post by:
I have created a treeview for my app that on MainFormLoad I have it get the list of drives with GetLogicalDrives() and populate the tree, then when I click the drive it adds the first level of...
0
by: charliewest | last post by:
I need to simulate a TreeView control in my asp.net application. It's not necessary to actually show the + and - symbols, and lines that connect the varying levels. All i need is to be able to show...
3
by: Jan Wrage | last post by:
Hi! I would like to implement a treeview in my existing application. It should show my entire Active-Directory structure, i.e. all Groups, Containers and OUs. Could somebody help me with...
0
by: MrNobody | last post by:
I want to display different menu item options depending on what the user right-clicks on the tree. I cant figure out how though, I currently tried to create separate ContextMenu objects in a...
3
by: bg_ie | last post by:
Hi, Lets say I have a TreeView with nodes that represent objects of a number of different types. Is there a way of associating the Set method of each object with its node in the TreeView? That...
1
by: Steve | last post by:
Hello! How can I realize, that when the Cursor is over an TreeNode, that the TreeNode will be underlined. I think the code must be in the "TreeNodeDataBound" Event, or? Regards Steve
0
by: Dennis Francek | last post by:
Hello I have populated a treeview from my dataset and by clicking in the treeview i want to get the corresponding table shown in a datagridview. Ive managed this by looking at each DataRow and...
4
by: frostbb | last post by:
I have a C# WinForms treeview with 20 or so 'level 0' nodes. My users will normally have 2 of the 'level 0' branches open down to a '5th level' selected node. The users will make updates to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.