473,586 Members | 2,555 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3004
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-
--

"PeteCressw ell" <Go**********@F atBelly.com> wrote in message
news:74******** *************** ***@posting.goo gle.com...
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_Cli ck()
' Purpose Collapse all nodes in the Tree
Dim i As Integer
If tvwGoalBank.Nod es.Count > 0 Then
DoCmd.Hourglass True
For i = 1 To tvwGoalBank.Nod es.Count
tvwGoalBank.Nod es(i).Expanded = False
Next
DoCmd.Hourglass False
tvwGoalBank.Nod es(1).EnsureVis ible
tvwGoalBank.Nod es(1).Selected = True
tvwGoalBank.Set Focus
End If
End Sub

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

Ron W
"Larry Daugherty" <La************ ********@verizo n.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-
--

"PeteCressw ell" <Go**********@F atBelly.com> wrote in message
news:74******** *************** ***@posting.goo gle.com...
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.Nod es(1).EnsureVis ible
tvwGoalBank.Nod es(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
11498
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
2547
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 the scroll bar to show the first 10 items. How do I change it to initially show the 1st ten items. I'm using a datareader to populate the...
6
14186
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 my database apps its common place to tell the user that they are working on record x of xxx records I'm trying to provide the same functionality...
3
2746
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 position against those values but I'm guessing there is a method to determine if the position is inside the bounds. If that is correct I...
1
2489
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 (TV1.NOdes.add...), and in that string, we'd pick the parent/relative node, so that it would be placed under the correct node.... How is that accomplished...
2
1653
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 TreeView1 in a web page and then I can set the “X” and “Y” of the ModalPopupExtender. Does anyone know how to do that? Or any suggestion is welcome. ...
5
6581
by: vincent90152900 | last post by:
How to get the position of a selected TreeNode of a TreeView? Any suggestion is welcome
1
1212
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> <asp:TreeNode Text="<span onclick='FindPosition(this)' id='node01'>Node 1</span>" Value="New Node"></asp:TreeNode> ...
0
2799
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 Form. A user can drag and drop a text(Usually from a tree node its name would be appended on drag and drop) in this control. Here user can put cursor...
0
7912
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...
0
7839
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...
0
8202
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
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...
0
8216
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...
0
6614
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...
0
5390
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...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
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.