473,372 Members | 1,240 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,372 software developers and data experts.

Accessing/Setting Custom Properties in a Custom TreeNode

I've figured out how to create a custom TreeNode with custom properties
and I can view those properties at runtime, but I'm not sure how to
change them after I've added the custom node to the tree.

For example:

Public Class CustomTreeNode

Inherits TreeNode

Dim _CustomProperty as String

Public Property CustomProperty() As String
Get
Return Me._CustomProperty
End Get
Set(ByVal value As String)
_CustomProperty = value
End Set
End Property

End Class

Add the node to the tree:

....
Dim myCustomTreeNode as New CustomTreeNode
myCustomTreeNode.CustomProperty = "Google is great."
TreeView1.Nodes.Add(myCustomTreeNode)
....

Read the property in the AfterSelect event:

....
Dim myCustomTreeNode as New CustomTreeNode
myCustomTreeNode = CType(e.Node, CustomTreeNode)
MsgBox(myCustomTreeNode.CustomProperty)
....

Now, how to I change the value of CustomProperty?

....
Dim myCustomTreeNode as New CustomTreeNode
myCustomTreeNode.CustomProperty = "Google is really great."
TreeView1.SelectedNode = myCustomTreeNode
....

This doesn't appear to work. Any suggestions?

Bishop

Nov 21 '05 #1
0 2575

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

Similar topics

5
by: Jason Butera | last post by:
I know that I can read/write custom properties of an object by using the following: Setting: document.all.customProp = "this"; Getting: document.all.customProp; Is there a way I can run...
0
by: John Svazic | last post by:
Hi, I'm trying to create an Add-In for MS Project and I want to be able to read some custom properties out from the Project. I'm using the Office Interop module that came with MS Project, and ...
6
by: Angel | last post by:
I have a button, combo, and custom control that i created. When I click the button i want to set certain display properties of my custom control depending whats in the combo. I set those properties...
0
by: Imar Spaanjaars | last post by:
Hi there, Can anyone tell me how to perform two-way binding with custom properties in ASP.NET 2? Let's say I have a custom class called Person that I want to bind to a FormView (using an...
2
by: Daniel Friend | last post by:
Hello, I have added a custom usercontrol programically and all works fine... I would like to change some custom properties that I have set in that usercontrol. Any help would be greatly...
0
by: george_Martinho | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older than a...
0
by: Giorgio | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older...
4
by: Suresh | last post by:
Is there any way to access the custom properties of a master page from the aspx form? I know the custom properties of a master page can be accessed from the aspx.cs partial class by specifying...
6
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.