473,785 Members | 2,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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._CustomPrope rty
End Get
Set(ByVal value As String)
_CustomProperty = value
End Set
End Property

End Class

Add the node to the tree:

....
Dim myCustomTreeNod e as New CustomTreeNode
myCustomTreeNod e.CustomPropert y = "Google is great."
TreeView1.Nodes .Add(myCustomTr eeNode)
....

Read the property in the AfterSelect event:

....
Dim myCustomTreeNod e as New CustomTreeNode
myCustomTreeNod e = CType(e.Node, CustomTreeNode)
MsgBox(myCustom TreeNode.Custom Property)
....

Now, how to I change the value of CustomProperty?

....
Dim myCustomTreeNod e as New CustomTreeNode
myCustomTreeNod e.CustomPropert y = "Google is really great."
TreeView1.Selec tedNode = myCustomTreeNod e
....

This doesn't appear to work. Any suggestions?

Bishop

Nov 21 '05 #1
0 2597

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

Similar topics

5
2212
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 code when this custom property is set. Or perhaps there is a way to create a custom method?
0
1350
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 there is a property in the Microsoft.Office.Interop.MSProject.Project object called CustomDocumentProperties which returns me an object, but this object is a System.__ComObject, which doesn't really help me very much. Can anyone help me out...
6
1684
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 in the Click_Event in the button control. Unfortunately postback is triggered in the click event before I set the display properties of the control. Is there anyway that I can set these properties before the postback is triggered? I'd like to do this...
0
1027
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 ObjectDataSource) for editing . The Person class exposes an Address property which in turn has ZipCode and City properties (both strings). How do I bind these to my FormView control? I tried Bind("Address.ZipCode") but I got an error stating I should...
2
1688
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 appreciated!!!! Thanks,
0
1685
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 specified date. - DeleteProfile. Enables you to delete a profile associated with a specified username. - DeleteProfiles. Enables you to delete a set of profiles. - FindInactiveProfilesByUserName. Returns a collection of ProfileInfo
0
2574
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 than a specified date. - DeleteProfile. Enables you to delete a profile associated with a
4
2791
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 the MasterType directive on the aspx form. My master page will render a custom navigation menu and I'd like to put in the properties of which tab and sub tab to load and other misc style info in the aspx form that can be used by master page.
6
11082
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 how those properties are set. I want to be able to do two other things: a) add User control instances to my page, filling in the place of placeholder controls, and b) programmatically setting custom properties on those dynamically spawned...
0
10152
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...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7500
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
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
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
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.