473,386 Members | 2,114 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,386 software developers and data experts.

How To Position A TreeView?

I wrote some code to let the user toggle between all expanded and all
collapsed, but it tends to leave the view of the tree where I'd rather
not have it.

Can't find anything via Google...

Anybody know how to force the view of the tree to a certain node...or
at least to the top?
Nov 13 '05 #1
3 2990
Hi Pete,

I plugged in another newsgroup where you're likely to get an answer from
Alex Dybenko. He's all over that Treeview stuff.

HTH
--
-Larry-
--

"PeteCresswell" <Go**********@FatBelly.com> wrote in message
news:74**************************@posting.google.c om...
I wrote some code to let the user toggle between all expanded and all
collapsed, but it tends to leave the view of the tree where I'd rather
not have it.

Can't find anything via Google...

Anybody know how to force the view of the tree to a certain node...or
at least to the top?

Nov 13 '05 #2
Pete below is code I used to Expand and collapse a treview control where the
tree is left on the first node when done.

Private Sub cmdCollapse_Click()
' Purpose Collapse all nodes in the Tree
Dim i As Integer
If tvwGoalBank.Nodes.Count > 0 Then
DoCmd.Hourglass True
For i = 1 To tvwGoalBank.Nodes.Count
tvwGoalBank.Nodes(i).Expanded = False
Next
DoCmd.Hourglass False
tvwGoalBank.Nodes(1).EnsureVisible
tvwGoalBank.Nodes(1).Selected = True
tvwGoalBank.SetFocus
End If
End Sub

Private Sub cmdExpand_Click()
' Purpose Expand all nodes in the Tree
Dim i As Integer
If tvwGoalBank.Nodes.Count > 0 Then
DoCmd.Hourglass True
For i = 1 To tvwGoalBank.Nodes.Count
tvwGoalBank.Nodes(i).Expanded = True
Next
DoCmd.Hourglass False
tvwGoalBank.Nodes(1).EnsureVisible
tvwGoalBank.Nodes(1).Selected = True
tvwGoalBank.SetFocus
End If
End Sub

Ron W
"Larry Daugherty" <La********************@verizon.net> wrote in message
news:IV**************@nwrddc03.gnilink.net...
Hi Pete,

I plugged in another newsgroup where you're likely to get an answer from
Alex Dybenko. He's all over that Treeview stuff.

HTH
--
-Larry-
--

"PeteCresswell" <Go**********@FatBelly.com> wrote in message
news:74**************************@posting.google.c om...
I wrote some code to let the user toggle between all expanded and all
collapsed, but it tends to leave the view of the tree where I'd rather
not have it.

Can't find anything via Google...

Anybody know how to force the view of the tree to a certain node...or
at least to the top?


Nov 13 '05 #3
RE/
tvwGoalBank.Nodes(1).EnsureVisible
tvwGoalBank.Nodes(1).Selected = True


BINGO!

Thanks.
--
PeteCresswell
Nov 13 '05 #4

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

Similar topics

42
by: lauren quantrell | last post by:
So many postings on not to use the treeview control, but nothing recently. Is it safe to swim there yet with Access 2000-Access 2003?
6
by: Vern | last post by:
I'm adding twenty nodes (Parent and child) to a tree view. Only 10 items are viewable in the window at at time. So when it initially shows the tree, it shows the last ten items forcing me to use...
6
by: meh | last post by:
I can figure out the total number of nodes in a given tree but what I'd like to know is what is the Selected Nodes relationship to the entire tree i.e This is node n out of nnn nodes. In most of...
3
by: **Developer** | last post by:
I need to know when the mouse is over the text of a TreeView node. I know how to get the Bounds of the node which appear to be the correct values to delineate the text. I could check the mouse...
1
by: Elmo Watson | last post by:
forgive me, but I'm fairly new to VB.Net - having only used VB6 in the past - - I can easily place a node on the treeview (tv1.nodes.add(key, text) BUT - in VB6, we'd add a child node...
2
by: vincent90152900 | last post by:
Following is my code and I want the Panel1 display beside the TreeView1. I found out the ModalPopupExtender has two property, “X”, and “Y”. So, I wish I could find out the position of a...
5
by: vincent90152900 | last post by:
How to get the position of a selected TreeNode of a TreeView? Any suggestion is welcome
1
by: vincent90152900 | last post by:
I want to know the position of the TreeNode. Does anyone know how to do that? Following is my code. <asp:TreeView ID="TreeView1" runat="server"> <Nodes> ...
0
by: nagarjunt | last post by:
Hi, This is nag. I have a problem with infragistics7.1 UltraTextEditor control. I am using C# code in windows form. I have UltraTextEditor control(With multi line enabled) in my Windows...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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,...
0
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...

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.