Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't See Data in TreeView or ListBox when using User Defined Class

Status
Not open for further replies.

Balarao

MIS
Jun 9, 2003
25
PH
Dear All,

I have created a ZipCode Class:

Public Class ZipCodeClass

Private mZipTree as TreeView

Public ReadOnly Property ZipCodeTreeView() As TreeView
Get
If mZipCodeTreeView Is Nothing Then
CreateZipTree()
End If

Return mZipCodeTreeView
End Get
End Property


The CreateZipTree() is a private sub of the ZipCode Class that places all the Zip Code in the mZipCodeTreeView nodes. This Work well.

The problem is when I call the property in my program:

Dim Zip as ZipCodeClass
tvwZipCode = Zip.ZipCodeTreeView

My tvwZipCode DOES NOT DISPLAY ANY NODES that the ZipCodeTreeView passes but the values of their properties and methods are the same. I tried using the method

tvwZipCode.GetNodeCount(True)
tvwZipCode.GetNodeCount(False)

and got the same number of nodes on both methods as in the ZipCodeTreeView.

tvwZipCode is a TreeView control I created using the VB.NET ToolBar.

Please help me find my nodes. :)

Thank you so much for your help.

God bless,

Balarao
 
and what does

tvwzipcode.nodes(0).count

give you.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Hi Chrissie1,

Thank you for responding.

i tried what you suggested "tvwzipcode.nodes(0).count"

An error occurred: Count is not a member of the 'System.Windows.Forms.TreeNode'

What do you mean by trying this code?

I tried using tvwzipcode.Refresh() after get the nodes in the class. Still doesn't work. :(

Please help.

Balarao

 
Dear All,

Really need help! Still can't solve this problem.

Anyone there?
 
Dear All,

I'm sure somebody out there can help me with this. I still can't see the contents of my TreeView.

Desperately need help... please...
 
Dear All,

I have created a ZipCode Class:

Public Class ZipCodeClass

Private mZipTree as TreeView

Public ReadOnly Property ZipCodeTreeView() As TreeView
Get
If mZipCodeTreeView Is Nothing Then
CreateZipTree()
End If

Return mZipCodeTreeView
End Get
End Property


The CreateZipTree() is a private sub of the ZipCode Class that places all the Zip Code in the mZipCodeTreeView nodes. This Work well.

The problem is when I call the property in my program:

Dim Zip as ZipCodeClass
tvwZipCode = Zip.ZipCodeTreeView

My tvwZipCode DOES NOT DISPLAY ANY NODES that the ZipCodeTreeView passes but the values of their properties and methods are the same. I tried using the method

tvwZipCode.GetNodeCount(True)
tvwZipCode.GetNodeCount(False)

and got the same number of nodes on both methods as in the ZipCodeTreeView.

tvwZipCode is a TreeView control I created using the VB.NET ToolBar.

Please help me find my nodes. :)

Thank you so much for your help.

God bless,

Balarao
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top