473,720 Members | 2,687 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

where is the Key in TreeView.NET?


hi
i working with TreeView in VB6, and have good Properity Named (Key)
with the Key i can goto Any Node i know hes Key.

but in VB.NET i can find the Key :(
please tell me where i can find the key in TreeView.Net...
-----------------------------------------------
Best Regards From Tark
Nov 21 '05 #1
77 14415
"Tark Siala" <ta*******@hotm ail.com> schrieb:

First, please do not make X-posts to groups that are not related to your
question's topic.
i working with TreeView in VB6, and have good Properity Named (Key)
with the Key i can goto Any Node i know hes Key.

but in VB.NET i can find the Key :(
please tell me where i can find the key in TreeView.Net...


The .NET Windows Forms treeview control doesn't provide lookup by key. What
you can do is storing the key in the 'TreeNode''s 'Tag' properties and then
add the nodes to a 'Hashtable' (use the 'Tag' property's value as key and
the reference to the 'TreeNode' object as value). Then you can easily
lookup a node by its key.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
Hi Tark,

Firstly,I would like to tell you that it's a gropu for VB6 users and for any queries related to dot net u can check out the following sites
microsoft.publi c.dotnet.genera l
microsoft.publi c.dotnet.langua ges.vb

As for your query, The .NET Windows Forms treeview control doesn't provide lookup by key. What you can do is storing the key in the 'TreeNode''s 'Tag' properties and then add the nodes to a 'Hashtable' (use the 'Tag' property's value as key and the reference to the 'TreeNode' object as value). Then you can easily lookup a node by its key.

HTH

Mona
"Tark Siala" <ta*******@hotm ail.com> wrote in message news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..

hi
i working with TreeView in VB6, and have good Properity Named (Key)
with the Key i can goto Any Node i know hes Key.

but in VB.NET i can find the Key :(
please tell me where i can find the key in TreeView.Net...
-----------------------------------------------
Best Regards From Tark

Nov 21 '05 #3
> "Mona (Grapecity)" <mo**@discussio ns.microsoft.co m> wrote in message
news:ez******** ******@TK2MSFTN GP15.phx.gbl...
Hi Tark,

As for your query, The .NET Windows Forms treeview control doesn't provide
lookup by key. What you can do is storing the key in the 'TreeNode''s
'Tag' properties and then add > the nodes to a 'Hashtable' (use the 'Tag'
property's value as key and the reference to the 'TreeNode' object as
value). Then you can easily lookup a node by its key.


Oh yeah... that's SO much better than having a Key property. So much for
".Net is more productive" eh? Gimme a break.

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..
Nov 21 '05 #4
In article <uJ************ **@TK2MSFTNGP09 .phx.gbl>, Ken Halter wrote:
"Mona (Grapecity)" <mo**@discussio ns.microsoft.co m> wrote in message
news:ez******** ******@TK2MSFTN GP15.phx.gbl...
Hi Tark,

As for your query, The .NET Windows Forms treeview control doesn't provide
lookup by key. What you can do is storing the key in the 'TreeNode''s
'Tag' properties and then add > the nodes to a 'Hashtable' (use the 'Tag'
property's value as key and the reference to the 'TreeNode' object as
value). Then you can easily lookup a node by its key.


Oh yeah... that's SO much better than having a Key property. So much for
".Net is more productive" eh? Gimme a break.


Hmmm, so one missing property damns the whole platform... Yes, there
are couple of things that are missing, that could have been done better
- but IMHO, overall, .NET is more productive.

--
Tom Shelton [MVP]
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 2 Build 2600
System Up Time: 41 Days, 21 Hours, 53 Minutes, 47 Seconds
Nov 21 '05 #5
"Tom Shelton" <to*@YOUKNOWTHE DRILLmtogden.co m> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..

Hmmm, so one missing property damns the whole platform... Yes, there
are couple of things that are missing, that could have been done better
- but IMHO, overall, .NET is more productive.


If were only one property then I'd say no. This is just one more case of
marketting hype lying to the public. How about this....

My.Computers.Pr inters.DefaultP rinter.Print("b labla")

....maybe someone in this huge crosspost list can tell me exactly how the
line above is "more productive" than VB6's

Printer.Print "blabla"
--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..
Nov 21 '05 #6
In article <uA************ **@TK2MSFTNGP11 .phx.gbl>, Ken Halter wrote:
"Tom Shelton" <to*@YOUKNOWTHE DRILLmtogden.co m> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..

Hmmm, so one missing property damns the whole platform... Yes, there
are couple of things that are missing, that could have been done better
- but IMHO, overall, .NET is more productive.


If were only one property then I'd say no. This is just one more case of
marketting hype lying to the public. How about this....

My.Computers.Pr inters.DefaultP rinter.Print("b labla")

...maybe someone in this huge crosspost list can tell me exactly how the
line above is "more productive" than VB6's

Printer.Print "blabla"


My is 2005, so I haven't really played much with that... But, I would
most likely not be typeing all of that anyway. See, I would probably
just add:

My.Computers.Pr inters to my global imports list or just type:

Imports My.Computer.Pri nters

At the top of my code file (depends on how often I was going to be using
it) and then all I would have to type is:
DefaultPrinter. Print ("blabla")

--
Tom Shelton [MVP]
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 2 Build 2600
System Up Time: 41 Days, 22 Hours, 53 Minutes, 47 Seconds
Nov 21 '05 #7
Wow, this is a very sad thread. VB People Fighting with VB People.

We are not the competition, we are not the enemy. VB5 or 6 or 7... It's VB.

Really, it is just that simple.

The real power of Visual Basic is simplicity through abstraction. That is
what made it a big deal in 1992, and that is what lead it to officially
beating COBOL as the worlds most used programming tool in 1998. C# is just
VB with a different language style for those people who never figured out
that "Visual Basic" was lightyears evolved from "B.A.S.I.C"

This is what the whole .Net deal really is all about: The *concept* of VB.
VB folks should be the strongest supporters of the evolution of the runtime
because VB is the parent to this child.

The framework is just a runtime, just like the VBRT/VMs. Garbage Collector?
Nothing new to us in the abstract sense. Power and RAD in one? Nothing new
to us at all.

And the VB7 language is a bit different in some places, mostly
understandable though ... changes had to be made to allow VB developers to
actually get what we had been begging MS for for a lot of years.

But Msgbox is still Msgbox and Dim is still Dim.

This particular silliness of number of Dots is nothing new to any of us.
You and I could make a load of VB5/6 object models that force the VB6
user-dev have to type dots, right? That isn't anything special ... the user
of the object model simply uses WITH (and WITH or Imports in VB7). Not
worth fighting your brothers about.

The enemy to the future of VB is the division between VB dev and VB dev, and
if it continues too long then the winners will be C# and - yes it's Still
True, I got my Borland "switch now" letter yesterday - Delphi.

Pick a version or use both and let others do the same, all usage helps VB.

Just my two cents as a very long-time passionate user of Visual Basic.

Robert Smith
Kirkland, WA
www.smithvoice.com

Nov 21 '05 #8
Yuck! That has "quick and dirty" written all over it. Are you a contractor
by any chance?

From a usability point-of-view that is nasty. You would have to iterate
through all the nodes to find the key that you desire!

The best solution is to inherit the treeview, overload the Item property
allowing a key as an argument, and store keys within a collection. All you
have to do then, is return the index of key and use this index to retrieve
the node. There is obviously more work involved here, as one would have to
handle nodes being deleted, sorted etc.

I have done this and it works a treat! I have had no performance issues
with large or small treeview node collections.

Landley

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:Oa******** ******@TK2MSFTN GP14.phx.gbl...
"Tark Siala" <ta*******@hotm ail.com> schrieb:

First, please do not make X-posts to groups that are not related to your
question's topic.
i working with TreeView in VB6, and have good Properity Named (Key)
with the Key i can goto Any Node i know hes Key.

but in VB.NET i can find the Key :(
please tell me where i can find the key in TreeView.Net...
The .NET Windows Forms treeview control doesn't provide lookup by key.

What you can do is storing the key in the 'TreeNode''s 'Tag' properties and then add the nodes to a 'Hashtable' (use the 'Tag' property's value as key and
the reference to the 'TreeNode' object as value). Then you can easily
lookup a node by its key.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #9
hi
yah VB7 not bad for New Programmer , but for old Programmer Using VB3/4/5/6
(Like me) , it's very very bad
new structure of language , Defferent Controls , Can't find Normal Old
Proberties (like Key)

i think i must Satr Learning VB from the First
:)
"smith" <rc********@smi thvoiceTAKEOUT. com> wrote in message
news:WN******** ******@newsread 1.news.pas.eart hlink.net...
Wow, this is a very sad thread. VB People Fighting with VB People.

We are not the competition, we are not the enemy. VB5 or 6 or 7... It's VB.
Really, it is just that simple.

The real power of Visual Basic is simplicity through abstraction. That is
what made it a big deal in 1992, and that is what lead it to officially
beating COBOL as the worlds most used programming tool in 1998. C# is just VB with a different language style for those people who never figured out
that "Visual Basic" was lightyears evolved from "B.A.S.I.C"

This is what the whole .Net deal really is all about: The *concept* of VB.
VB folks should be the strongest supporters of the evolution of the runtime because VB is the parent to this child.

The framework is just a runtime, just like the VBRT/VMs. Garbage Collector? Nothing new to us in the abstract sense. Power and RAD in one? Nothing new to us at all.

And the VB7 language is a bit different in some places, mostly
understandable though ... changes had to be made to allow VB developers to
actually get what we had been begging MS for for a lot of years.

But Msgbox is still Msgbox and Dim is still Dim.

This particular silliness of number of Dots is nothing new to any of us.
You and I could make a load of VB5/6 object models that force the VB6
user-dev have to type dots, right? That isn't anything special ... the user of the object model simply uses WITH (and WITH or Imports in VB7). Not
worth fighting your brothers about.

The enemy to the future of VB is the division between VB dev and VB dev, and if it continues too long then the winners will be C# and - yes it's Still
True, I got my Borland "switch now" letter yesterday - Delphi.

Pick a version or use both and let others do the same, all usage helps VB.

Just my two cents as a very long-time passionate user of Visual Basic.

Robert Smith
Kirkland, WA
www.smithvoice.com

Nov 21 '05 #10

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

Similar topics

8
4404
by: Hrvoje Voda | last post by:
What is wrong in this code? private void tree_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode == Keys.Enter ) {
6
4932
by: L.M | last post by:
Hello, I knew how to use the treeview under VB6. After migrating to .NET, well, I'm lost. I try to add a new node, either to the same level or as a child to a selected node in the treeview. However, either it only add it to the root level or it only add it on level below, doesn't matter what I select. And in some case, I just get an exception.
14
15095
by: Mr.D | last post by:
How do I save/load the contents of a Treeview to a file? I have found several good examples written i VB6, but not a single one for VB.NET. Please help. ---- Tim
2
7497
by: Tymbow | last post by:
I'm building a web application that is analogous to the Windows XP file explorer in function. The left column contains a TreeView, and the right column a DataGrid populated by selecting TreeView nodes. The TreeView populates dynamically as there are a significant number of nodes. The DataGrid displays both the items and the nodes from the TreeView. Using the explorer analogy this means the TreeView shows folders, and the DataGrid folders...
1
2562
by: musosdev | last post by:
Hi guys I was using the Microsoft.Web.UI.WebControls extra namespace in my application to provide me with a TreeView control. I was using specifically ..GetNodeFromIndex(), SelectedNodeIndex and NodeData. All 3 of which are now giving errors is the new Asp.net TreeView. I'm found the Value property which replaces NodeData, but what about GetNodeFromIndex and SelectedNodeIndex. Are they just... gone!? :(
1
693
by: kvicky | last post by:
I am trying to load child nodes to a TreeNode in a TreeView in a ASP.net web application. The Treeview with parent nodes are loaded on a Page_load while doing if( ! ISPostback ) and then in the Treeview event I am dynamically trying to load the child nodes to the exisisting TreeView. The problem is since the TreeView is being loaded on not a Postback, I am unable to refer to any node in the TreeView event. Can anybody tell me how to...
1
3650
by: Victor Rodriguez | last post by:
Is there a way that I can have a client side event like oncontextmenu="showfunction();" on each node? thanks, Victor
8
12771
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the form. I only want to allow single selection, so using checkboxes is out of the question. It works as is, but it makes the form very cumbersome if every time that a user selects a node, the whole page has to reload. Is there a way to have a node...
2
1556
by: casManG | last post by:
I am working on a small project that uses the treeview control in .net 2003. I have a tree view that I am sending to a sub in order to iterate through the nodes. Public Sub test (ByVal inTreeView as Tree View) But, the thing I want to do with the inTreeView requires me to expand all the nodes before I iterate. The problem is that when the sub is complete, the original tree view on my form ends up with all of the nodes expanded I had...
0
8834
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8727
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9212
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9127
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8002
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4483
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4748
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3186
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.