Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Moving List (TreeView VB6)


Hey,

I have a list, and I was wondering if there was a way to move an item e.g. from 3 > 4 or 4 < 3 by clicking on a command button? Also if you can drag and drop them to the position that you want them to be in?

Thank You




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Moving A Node From A Treeview To Another Treeview
I have created a program that displays 2 treeviews, let's call them treeview1 and treeview1. The content of the nodes are taken from 2 different xml files. I would just like to know how i can click, drag and drop a node from treeview1 to treeview2. thanks!

Moving Nodes Around A Treeview
I have a treeview control populated from a database with nodes like this:

Code:
Node1
leaf1
leaf2
leaf3
I want to be able to allow the user to drag leaf3 over leaf2 and have if appear between leaf1 and leaf2. So my result would be:

Code:
Node1
leaf1
leaf3
leaf2
Any ideas on how I should go about this?

Moving Treeview Node
I'm currently programming a treeview that as the possibility to move a node between two others. Does anyone know how or a place that I should check for that ...


Node1
----node1.1
----node1.2
----node1.3

when I'll drag the node node1.3 and move upward I want that this node goes between the node node1.2 and node1.1 ...


Thank you,

Moving Nodes In A Treeview
How to move nodes in a treeview. including changing its parent?

Moving Treeview Nodes
I've searched through the whole forum (I think), and cannot find the answer to this question:
I have a Treeview control and a Toolbar that should allow the nodes to be moved up and down, for example:

Parent
Node 1
Node 2

If Node 2 is selected, and the Up toolbar button is pressed, the Treeview will change to:

Parent
Node 2
Node 1

This should also ensure that Node 2 still has it's child nodes if it had any. Can anyone please help?

TreeView Issues - Moving Nodes
I'm writting an MSN clone because I don't like all the fluff the original client comes with. Anyway, I have a treeview set up for my buddy list something like this

ContactsOnlineAll Online ContactsOfflineAll Offline ContactsMy problem is. When I move a contact from Offline to Online or vice versa other nodes get removed or renamed and junk. I'm using the following proceedures.


Code:
'To set up my treeview in the form_load I have something like this

tvwBuddies.nodes.add text:="Contacts"
tvwBuddies.nodes.add 1,tvwChild, ,"Online"
tvwBuddies.nodes.add 1,TvwChild, ,"Offline"

'I also setup images and stuff but that's not important for this question

When receiving the buddy list and adding the contact they are all placed under the offline until the server tells me they are online


Code:
'add a contact to the offline

tvwBuddies.nodes.add 3,tvwChild, ,Buddy(i).name
Buddy(i).Node=tvwBuddies.nodes.count
tvwBuddies.nodes(Buddy(i).node).tag=Buddy(i).email

Now moving the contact to offline or online


Code:
tvwBuddies.nodes(buddy(i).node).remove 'remove the node

'add the node under the online section
'2 would be 3 if we were moving them to offline
tvwBuddies.nodes.add 2, tvwChild, , Buddy(i).name

'reassign the node value for buddy(i)
Buddy(i).node=tvwBuddies.nodes.count

tvwBuddies.nodes(buddy(i).node).tag=buddy(i).email


Can anybody point out anything I could be doing wrong. Any help is appreciated, I'm getting pretty frustrated.

Moving Treeview Nodes From One Parent To Other?
there are 2 "Root" nodes of a treeview. They both have child nodes. OK, now I want a code that can do the following:

If a variable = "the text of a child node" Then
Move that child from that root to the other.

How can I do that?

MOVING TO NEXT NODE In A Treeview (solved)
How to determine if SOMETHING is selected in a treeview?

THIS IS THE QUESTION OF THE OLD TOPIC NAME SEE LAST POST

Treeview Troubles (moving Nodes)
I have a treeview with some nodes, most of which have child nodes (as per screenshot)



The up and down buttons on the right are destined to contain code that will move the selected node up or down a place within the same level, so for example "sql default" (and it's children) should move down below "connect Customer Database" whereas the "Connect" child should move up above the "Access" child.

I've tried everything I can think of, any ideas?

As an incentive I will toss a proverbial cookie in the general direction of the person with the answer! Thanks

Moving Nodes In Treeview Control
Hi there. I'm having a bit of trouble with the Treeview control so hopefully someone can help.

I have populated the Treeview control with a number of Parent/Child nodes. I want the user to have the facility to move/re-arrange these nodes so I have created 'move up' & 'move down' buttons next to the Treeview control.

My question is, if a user clicks the up or down buttons on my application, how would I go about moving the selected node up or down the Treeview control. (I have tried changing the index value, but this appears to be read-only)

Any assistance would be greatly appreciated.

Moving Data With Dragging A Treeview Node
i want to move data about a Database connection , from the treeview to a listbox.

i know i could use a ADODB recordset....any ideas how ?

thanks

Treeview Node_click() Event Firing When Moving Up / Down In Tree
hello,
as i said in the title, the node_click event is firing when i am moving through the items of the tree with (direction keys) . I am not clicking nor pressing ENTER, then why this event is firing?

It is causing me problem as the user has to browse first throught the items of the tree and then presses { enter }, for his desired operation. It won't be good as the user presses a direction key (eg, vbkeydown), and the first item (the associated program) launches.


Is there a solution to my problem ?
Should i change event ?

Please help me if possible

Thanks

Moving Mouse Over The List Box
Hi, I am trying to manually make my own Menu Editor. I don't like how you cannot edit the font and color of the regular menu editor.I got it all working and looking great, but there are 2 small problems that I cannot figure out how to fix.

I want to be able to move the mouse over a list box, and just like a regular menu I want the one that is under the mouse to be highlighted. And as you move the mouse over different selections it will highlight them, without yet clicking on the mouse, anyone know how to do that?

Also, does anyone know how to change the forecolor of a command button? It is possible?


I appreciate any help.

Thanks,

Dan

Moving Items To The End Of The List!
hi!all!
i am looking for a code to move a selected item to the end of the list box!

for example i have a list1 with items
1
2
3
i select the first item ,item 1 and then click the button!
the item should move to the end of the list and the list would look like>
2
3
1
---------------------------

Moving Items Up And Down In A List Box...
Hey guys, I was wondering if anyone can help me on how to move items up and down a list box? Also, if I want to move an item start from the bottom to the top?

Please, help me...

Moving Items Around A List Box
hi !
I have yet another short query here..and would be grateful if anyone could help.
I got a list box with a playlist for a radio show..and to the right of it i have 2 more listboxes..one with duration of track and the other with the point in time at which the track starts in the show.
I have 2 buttons below up and down which when clicked on move the selected item up or down in the playlist accordingly along with the related times.
How do i do this ?
Also how do make sure that there is one item selected at aLL times.
any help would be great !

Harpooon

Moving Up && Down In File List Box
heyy guyz..

i was wondering...if i have a file list box with many files in it...how can i cause the cursor or watever to move to the next file down or up, to the beginning, and to the end of the list of files (and if possible cause the cursor to move randomly as well)...

and if it does move...under which event would that be?? example: file1_change??

thanxx in advance

Moving Lines Within A List Box
hello,
i have a list box and i want to move some lines in it, but here is the catch;

i built the list like this:
i have a 'brake' line and then some other lines starting with " " (4 spaces). it serves me as groups.

what i want to do is move the entire groups up and down.
i keep failing on managing to do this..

it looks something like this:

brake1
line1
line2
line3
brake2
line1
brake3
line1
line2

i have between 2 and 10 brakes and as many lines between them.. (they also have unique names; not 'brake' and 'line').

also,
the up and down buttons are only enabled when i'm on a brake.
they are disabled seperatly when i'm on the first or last brake.

when i click on my up button (for example when i'm on brake3);
it will replace brake2 and look like this:

brake1
line1
line2
line3
brake3
line1
line2
brake2
line1

and so is with the down button (on brake1);

brake3
line1
line2
brake1
line1
line2
line3
brake2
line1


after this, i also want to be able to move the lines up and down, but to disable the buttons when i'm on the first line and the last line.

(i only use 2 buttons; 'CmdUp' and 'CmdDown')

i use this line to tell when it's a line and not a brake;
if left$(list1.listindex,4)=" " then blahblah..

i only managed to get the brake (any) to become the first of the list, and not even go down...

help?
thanks in advance..

Moving All Items From One List Box To Another
I am having problems selecting the first item in the list box. Here is the code that I have written:

Private Sub ZonesAll_Click()
Dim ZoneName As String
Dim ZoneNumber As Integer
Dim n As Integer
Dim i As Integer
n = Me.ZonesNotSelected.ListCount

'I need a line here that will select the top item in the list

For i = 0 To n - 1
Me.ZonesNotSelected.Selected
ZoneName = Me.ZonesNotSelected.Text
ZoneNumber = Me.ZonesNotSelected.ListIndex
Me.ZonesNotSelected.RemoveItem ZoneNumber
Me.ZonesSelected.AddItem ZoneName
Next i
End Sub

Thanks
SLR

Moving List Items Up And Down
This is a bit foolish question bu I forgot how to do it.
I want to move items listed in the list box up or down. How do I do it?

Kinjal

Moving Items Up/Down In List Box W/VB
There is another thread in the javascript section with almost the same title, so what I am wondering is if there is a VB version of it. The thread id is

URL

Any help would be greatly appreciated

Moving A Item In A List Box Up Or Down
I have two buttons on a form and I want the be able to click the up button then move the selected item up or click the down button and have the item go down.

Any Ideas?

Code For Moving Items Up/down List Box?
Anyone know how to move items up or down the order in a list box. Thx

Moving Item Between List Boxes
I have a command button with the Caption ">". When clicked I want the selection the user has made in ListBox1 to be moved to ListBox2.

Anyone ever do something like this before?

thx..

Moving Through The Files In A File List Box...
Hey everyone,

As the title states I am trying to move through files in a file list box. For example...if the file list box contains 3 files and the user selects all 3 and clicks on a delete button, a loop will be activated like below that will update the selected index and call the delete confirmation each time. The problem is I don't know how to get the selected index to change. I have tried filelistbox1.selectedindex.equals(count) but the selected index never changes from 0. If this isn't clear post back and I'll try to explain it better...any help would be greatly appreciated. Thanks in advance

Code:Dim count As Integer = 0

Do Until count = FileListBox1.SelectedItems.Count
                
                'update selected index so when frmdelete is called it uses the right filename

                frmdelete.show
                count = count + 1
Loop



Edited by - piles on 6/20/2007 8:10:01 AM

Moving Data Between List Boxes
Hi,
I need a little help if anyone has a moment. I have 2 list boxes one called lstSource and the other is lstDestination. I have it set up and working so that I can multi select rows in my source and move them into my value list in my destination list box. I call the function in the click even of a right arrow button. This works great.

Now I want the user to be able to remove fields from the lstDestination in case they make a mistake or change their mind. I want to do this using a left arrow button but I can't quite get the code working properly. I have gotten it to do everything butx but....however, I can't get it to just delete the selected row(s). Here is my code that is working to move my rows from my lstSource to my lstDestination. I assume it must be some variation of this....

<vb code>
Private Sub cmdCopyItem_Click()
CopySelected Me
End Sub

Function CopySelected(frm As Form) As Integer
Dim ctlSource As Control
Dim ctlDest As Control
Dim strItems As String
Dim intCurrentRow As Integer
Set ctlSource = frm!lstSource
Set ctlDest = frm!lstDestination
For intCurrentRow = 0 To ctlSource.ListCount - 1
If ctlSource.Selected(intCurrentRow) Then
strItems = strItems & ctlSource.Column(0, _
intCurrentRow) & ";"
End If
Next intCurrentRow
' Reset destination control's RowSource property.
ctlDest.RowSource = ""
ctlDest.RowSource = strItems
End Function
</vb code>

Moving Scroll Bars On List Box Simultaneously
could someone please tell me if it is possible to somehow link listboxes in an array so they all scroll together? thanks

Searching For And Moving E-mails In An Outlook PST From A List In Excel Using VBA
Hi there,

I was hoping someone might be able to give me some guidance - I have the task of sorting various e-mails in a master PST, into seperate folders based on a list of e-mail addresses which have been extracted from the PST, and are stored as a simple Excel workbook.

the current list of addresses reaches around 5000 items, and so doing this manually would be a extremely burdensom task - I was hoping that this would made fairly simple by the use of a VBA marco, and it could be easily recorded however Outlook does not allow the recording of macros. I've also been reviewing various samples, but cannot make head nor tail of what needs to be done, and my experience with VBA is fairly limited.

Basically what needs to happen is:
- vba selects the e-mail address from a cell in Excel, and copies this value
- changes to Outlook, and performs a search on the Inbox for the copied value (e-mail adress) as the sender, and then moves any e-mail item found with this value to a seperate folder
- goes back to Excel, and repeats the process to select the next cell's value.

If anyone would be able to help or provide some guidance or sample code, it would be greatly appreciated!

Best regards,
Nick

Treeview No List?
Well i'm using a treeview to display users in the chat, it updates each chat with the new users that join but does not display the old people that joined before them so i tryed writing this to send the server's treeview user list to everyone can someone help me out i can't get it to work. Heres the code, i use another winsock to connect the server to itself to send the commands and back out to everyone threw another sock.


Code:
'add user to list
If A(FirstData) = "Welcome " Then
Set TreeView1.ImageList = ImageList1
TreeView1.Nodes.Add , , A(SecondData), A(SecondData), "smiley", 1
For U = 1 To TreeView1.Nodes.Count
N = N & Len(TreeView1.Nodes(U).Next.Index) & TreeView1.Nodes(U).Next.Index
Next U

J = "Welcome " & "~" & N
Winsock2.SendData J
End If


any help plz :S treeview jus so much more complex then listbox ~_~

Saving A TreeView List
Now that I figured out how to add to a TreeView, I need to know how to save the treeview with the newly added nodes. Can it be saved to a text file like the ListView?

Code:
Private Sub SaveList()

Dim i As Integer

Open App.Path & "TreeViewList.txt" For Output As #1
For i = 1 To TreeViewList.ListItems.Count
Write #1, TreeViewList.ListItems.Item(i)
Next i
Close #1

End Sub

Need Help Loading List Into Treeview
Hey,

I have a listbox with some entries which I need to load into a treeview.
I'm having trouble doing so... I can't get it to work even remotely...

The llist looks like this (actual screenshot):


To explain, the 'format' of the entries are like this:
<number> - <key> - <value>


The treeview headers, parents, whatever they are called (the first nodes you can expand) should be all the "classname"s...

For example, if you look at entries 7 to 10 in the pic, the headers should be:

Code:
+ corona
+ corona
+ misc_teleporter_dest
+ misc_teleporter_dest

etc...

Their children should be the other key/value's of the same number.
Again, entries 7 to 10:

Code:
+ corona
origin - -1836 bla..
+ corona
origin - -1100 bla...
+ misc_teleporter_dest
origin - -1976 bla...
targetname - 1bu
+ misc_teleporter_dest
origin - -1872 bla...
targetname - 1bd
etc...


There is another catch though,
The 'classnames' should ONLY be listed when they have either a SCRIPTNAME or TARGETNAME. If they don't have any of those, they should not be in the treeview.

I can't think of a way on how to do this...
I probably have to split the entries by " - " to seperate the number key and value, but how do I store them correctly in an array for example, so it will be easy to get into the treeview ?

I guess the question is, how do I store the entries in an array (2D, 3D, ?) so I can easily put them into a treeview and also use them later?

Treeview Checked List Help Please!
I've got a treeview populated by databases. Each Leaf represents a seperate database (company uses lots).
I need to keep a list of all leaves' checked property.
I have a function that checks a parent's children if the parent is checked, with multiple parents being independant of each other.
Something like this:

|-Root
|___ Parent 1 (checked = true)
| |__leaf 1 (checked = true)
| |__leaf 2 (checked =FALSE)
| |__leaf 3 (checked = true)
|
|___ Parent 2 (checked = true)
| |__leaf 4 (checked = FALSE)
| |__leaf 5 (checked = FALSE)
| |__leaf 6 (checked = true)
| |__leaf 7 (checked = true)
|
|___ Parent 3(checked = FALSE)

_____________________
| Checked List: |
| leaf 1 |
| leaf 3 |
| leaf 6 |
| leaf 7 |
---------------------------------

I need to have a list of which LEAVES (children) are checked as they represent the actual different databases, whereas the parents are only used to group related (in terms of purpose) databases.
Leaves checked need to have the text pty added to the list, and unchecking should remove it from the list

In short:
1. If I check a parent, all its children must be checked, and vice versa.
2. As a leaf is checked, it must be added to a list, and vice versa.

My current code is no good:

VB Code:
Private Sub tvw1_NodeCheck(ByVal NodeX As MSComctlLib.Node)  CheckChildren NodeX 'Call subroutineEnd Sub Function AddCheckedToList() '(node As node)Dim nodX As Node, i As IntegerDim strChecked As String  For i = 1 To iNodeCount 'create single multiline string to display which leaves are selected    strChecked = strChecked & vbCrLf & "bcheckedarray(" & i & ").checked = " & bCheckedArray(i)  Next    MsgBox strChecked End Function Private Sub CheckChildren(Node As Node)Dim i, j As Integer, nodX As Node   If Node.Children <> 0 Then 'If node has children    Set nodX = Node.Child 'Catch first child    For i = 1 To Node.Children 'Loop through each child      nodX.Checked = Node.Checked 'Set as checked      If IsNumeric(Left(nodX.Text, 1)) Then        bCheckedArray(Int(Left(nodX.Text, 1))) = nodX.Checked 'set arrayitem as 1 if checked = true      End If      If ((Left(nodX.Text, 1) >= 0) And (Left(nodX.Text, 1) <= 9)) Then '## if leaf start with number in text pty        If nodX.Checked Then          lstRestore.AddItem (nodX.Text)        Else          For j = 0 To (lstRestore.ListCount - 1)            If lstRestore.List(j) = nodX.Text Then lstRestore.RemoveItem (j)          Next        End If      End If                        AddCheckedToList '(node)      CheckChildren nodX 'Recursive check to see if this node has children            Set nodX = nodX.Next 'Catch next child    Next 'Loop   End IfEnd Sub

List And Treeview Problem
Can someone please help me.
I am using a listview and a treeview to display information. In either view. if I select a line twice the text seems to go into edit mode (although it is not really changed - it just looks like it) - similar to renaming a file in windows explorer. Can I disable this. I still need to be able to select different lines in the listview and treeview so cannot use the 'enable' property.

List To Array (Treeview)
Any idea how to convert this list, which is in a acces table:

From TO
LucWilliam
GlennWilliam
WilliamRonny
RonnyGuido
HeidiRonny
HermanRonny
YvesHerman

to a treeview structure like this (do not mention the points):

Guido+
..........Ronny+
......................William+
....................................Luc
....................................Glenn
.......................Heidi
.......................Herman+
.................................... Yves

or in an arra like this (the order of the lines is not important):

Luc,William,Ronny,Guido
Glenn,William,Ronny,Guido
Yves,Herman,Ronny,Guido
Heidi,Ronny,Guido

Any help would be greatly appreciated.

File List Using TreeView
Not sure if this is the right approach but I want a tree view with nodes showing directories and files. However I want to limit which files (by extension) to include. Is there an API that gets the contents of a given directory?

I was thinking of using a hidden FileList for gathering the files but that isn't working as well.

Any help available?

Thanks

Scott
The worst thing about wearing glasses is them being on your face.
Nothing is impossible, it just looks that way.

Image List && Treeview
Hi,

    Can anyone tell me howto populate a Treeview with icons, is it possible to do this without using an image list, if so how?, and if not how?, ive tried using the image list, but im having problems with it.

Also, to do this do i need the icons to be seperate files from the compiled exe, can i not somehow add the icons to the vb6 project and compile it within the exe?

Thanks

Paul



Edited by - breakfast3001 on 9/6/2004 8:04:54 AM

Generating A List Of Nodes From A Treeview
Hello, I'm new to VB. I've been self-teaching myself for about 2 weeks(knew a little access basic before so it's not too bad). Anyway, I'm developing an app and I'm creating a combo box with the list of folders in my treeview. I want to preserve the order(and subnodes) while creating this list.

I'm building a routine but I hit a stumbling block because there seems to be no way of determining if a node exists when using the node.next method. Here's the code I have so far(folderview is the treeview):

Dim tempnode As Node

For i = 1 To (FolderView.Nodes.count)
With FolderView.Nodes(i)
If .Text <> "Main" Then
If (.Children > 0) Then
morenodes = True
Set tempnode = .Child
Do While morenodes
MsgBox (tempnode.Text)
If IsObject(tempnode.Next) Then
' MsgBox ("exists")
Set tempnode = tempnode.Next
Else
' MsgBox ("no exist")
morenodes = False
End If
Loop

End If
End If
End With
Next i

This should go though and for every branch that has children list each child. It works except it stumbles after the last child. The "IsObject" can't tell if tempnode.next is valid or not. Is there a way to test for this? Or a different, better way of doing this?

Thanks

Drag Data From List To Treeview
I want to know which methods are used while dragging from
1. List to Treeview.
2. Drag a url or href from a browser control to tree view
3. Drag a url or href from a browser control to List view.

And all i want is while dragging over on the target control the contols item(list item in listview, nodes in tree view) must be highlited and made selected (blue bgcolor)

It would be easy for me if u give some samples for this

Thanx in advance !

Treeview : Putting Item First On List
Does any of you know how to move a node to the first position on the list? like this?


-Group
--item
--item 2
--item 3

but i want to get this

-Group
--Item 3
--item
--item 2


But i dont want to change the name in anyway other things might do thanks

Load A Tree List From A File To TreeView
Hi,

I am new here and I hope someone can help me out on TreeView.

I have a very long list of Tree (it is formatted something similar to .INI file) and I would like to load the list into my GUI TreeView.

How can I go about doing that?

TIA.

Mike

Treeview - How To Get List Of Child Nodes For A Node
Hi,

I think this is a pretty easy question, but I can't seem to find the answer in my search.

Let's say I have a treeview called treeview1. It's got three main nodes: BigNode1, BigNode2, and BigNode3. Each has some child nodes, like this:


Code:
BigNode1
LittleNode1
LittleNode2
LittleNode3
BigNode2
LittleNode4
LittleNode5
LittleNode6
BigNode3
LittleNode7
LittleNode8
LittleNode9


How do I get a list of the child nodes for one of the big nodes?

Thanks in advance.
-Bret

Initialize An Image List [TreeView Error] (Resolved)
hey ya,

I'm using a tree view to show a returned username & chat room to a person's search from my chat server,

and add the items like:


VB Code:
' Add the user name to the list            Dim n As Variant            Set n = tvRes.Nodes.Add(, , , SplitArr(0), imgLst.ListImages(1).Picture)            ' Add the users location to the list view            If InStr(SplitArr(1), "PRIVATE ") Then                tvRes.Nodes.Add n, tvwChild, , "(Private)", imgLst.ListImages(2).Picture            Else                tvRes.Nodes.Add n, tvwChild, , SplitArr(1)            End If


TreeView = "tvRes"
Username = "splitArr(0)"
Room = "SplitArr(1)"

only, i get the following error, and don't understand why?


Quote:




---------------------------
The Walks Chat
---------------------------
Error 35613: ImageList must be initialized before it can be used
---------------------------
OK
---------------------------






how do i initialize the image list? [is this the image list for the imgLst or for TreeView.ImageList?

Detecting Click On Text Or Image In Treeview List
Hello all,

I am making myself a little treeview control and having it working fairly well thus far. That item in which I need assistance is determining whether the user clicks on the text of the node or the image of a node. Is there a way to detect that action? Each node has a home made check box where I am using the images to indicate this. If the user clicks on the text for the first time I want to pull up the data and display it then on the second click on the text it selects the node so I can download the information later. I have this part working, but I want the program to select a node each, indicated by a checked box image, but it the current data display doesn't have to be from that node. I hope that make some sense. Thanks for the help

Mark

Code For Moving To The First Blank Cell In A Worksheet; Moving Left,right,up Or Down
I have created an application form as a userform in Excel. I need to send the data entered into my text boxes when the program runs to separate excel cells in a worksheet.

My problem is I can use code that will send the textbox entry to a specific cell eg. If my textbox is named Surname I can say

range("a5").value = surname but if I do that when I run the programme to enter the next record for someone else the first record will be overwritten.

I NEED A CODE LINE THAT WILL TAKE ME TO THE FIRST EMPTY CELL AND ALLOW ME TO MOVE DOWN OR TO THE LEFT OR TO THE RIGHT

Moving Balls To Moving Images??
Please take a look at this as it is related to my question
Thread

is it possible for the create images to be an image type that is already drawn?

Treeview - Capture Click Of Treeview Image
Hi,

I have a treeview where I am using the node image to mimic the functionality of a checkbox. Initially the node image (for topmost nodes only) is set to an image of an unchecked checkbox.

Is there any way to determine if the user clicks on the node image (and not the node text). I need to be able to alter the image from unchecked checkbox image to a checked checkbox image when the user clicks this image. However, I still want to allow the user to click the node text to expand/collapse the node as is the standard for this control.

Any help would be much appreciated.

TreeView - Want To Highlight Part Of TreeView
Hi, This must be a simple 1 line of code:

Have some VB code I didn't write, I am modifying it. Works OK but want to do one thing:-

The treeView has 1 branch called [NEW] A branch is inserted in and is highlighted (say called "hello"). I would like to set the highlight to the branch called "hello" not the original branch called [NEW].

The TreeView is called TVWizard.

I have used:-

TVWizard.setfocus

This sets the focus of the TreeView object. I somehow need to move the highlight to the "Hello" branch (node)

ONLY STARTED VB FEW WEEKS AGO, ANY HELP APPRECIATED

take it need something like TVWizard.Node("hello").focus = true ?????????

[VB6][TREEVIEW] How To Unchecked The Treeview Node
I would like to make a function for the user, when a user checked any of the parent node, the entire of child node and parent node will checked.
I tried to write on myself. The child node will checked if checked on parent node. However, i can't unchecked the child node if parent node unchecked.


Code:
Dim IndentifyCheck As Integer
Dim nodMP As Node
Dim nodP As Node
identifycheck = 0
If Node.Checked = True Then
If Not Node.Parent Is Nothing Then ' Parent exist.
Node.Parent.Checked = True
If Not Node.Parent.Parent Is Nothing Then
Node.Parent.Parent.Checked = True
End If

End If
If Not Node.Child Is Nothing Then
Set nodMP = Node.Child
Do Until nodMP Is Nothing
nodMP.Checked = True
If Not nodMP Is Nothing Then
Set nodP = nodMP.Child
Do Until nodP Is Nothing
nodP.Checked = True
Set nodP = nodP.Next
Loop

End If
Set nodMP = nodMP.Next
Loop

End If
Else
Do Until Node = Node.LastSibling
If Node.Checked Then
identifycheck = identifycheck + 1
End If
Set Node = Node.Next
Loop
If identifycheck < 1 Then
If Not Node.Parent Is Nothing Then
Node.Parent.Checked = False
If Not Node.Parent.Parent Is Nothing Then
Node.Parent.Parent.Checked = False
End If
End If
End If
If Not Node.Child Is Nothing Then
Set nodMP = Node.Child
Do Until nodMP Is Nothing
nodMP.Checked = False
If Not nodMP Is Nothing Then
Set nodP = nodMP.Child
Do Until nodP Is Nothing
nodP.Checked = False
Set nodP = nodP.Next
Loop

End If
Set nodMP = nodMP.Next
Loop

End If

End If

Copyright © 2005-08 www.BigResource.com, All rights reserved