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




Show Item Text When Dragging A Treeview Node


Does anybody know how when dragging a treeview node, to display the text property of the node as well as the DragIcon. I want to be able to replate the drag drop behaviour of Windows Explorer, i.e while you are dragging a folder, you can see the folder name in transparent text.

I have no problem setting the DragIcon property from an imageList I have associated with the treeview. For example in the DragOver event I am setting the DragIcon based on whether the mouse is over a valid drop point. E.g. .DragIcon = LoadResPicture("NoDrop", vbResCursor)

However it only shows the DragIcon and nothing else when dragging the node. Any help appreciated.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Treeview Control Should Show Different Line Of Text Or Evrey Node I Click....
Hello friends,

I am working on vb6.
In vb6 i took 1 form and added 1 treeview control and 1 text box. For every node i clicked in the tree view it showed the same line of text for every node in the text box.
Our requirement is as follows............
1. For every node i clicked in the tree view should show the different line of text for every node in the text box.
i.e for node1 ---It shold show -Welcome
for node2 ---It shold show -This is vb
for node3 ---It shold show -In vb6 u can do ----(i.e 1 paragraph of text in this node). Well here whenever i click on vb6 word in this node 3 it should open 1 more page(i.e it should get linked with another page)

2.How to link one page to another page

Please Somebody help me

Thankss in advance
Prity

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 - How To Drag A Node Item To Another Node Group
I have a program that im making, which has a treeview control. Ive got everything finished BUT, i need to make it so that the user can grad a node from one group, to a different group, and have it actually be placed in the group where it is dropped. Think of it like your lnstant Messenger buddy list.

Buddies:
User1
User2
User3 <--
User5 <-- The user should be able to drop "User4" between there.
User6
Family:
User7
User8
User4 <-- The user needs to be able to drag and drop this node to the
User9 "Buddies" group above.

I hope that little diagram thing helped explain what im trying to achieve. Ive played around with this for a bit, but i just started working with the treeview control so im not very familiar with it, also, ive never done anything with a drag/drop effect before. However, ive looked around the forum and ive found how to drag a node to another item in the form, like a textbox or something.

I really need help with this and it would be realllly appreciated if someone could help me get it to work. Thanks.

TreeView - Dragging And Dropping A Node In The Middle Of A Level
Does anyone know how to drag and drop a node within a treeview control in the middle of a level on the same treeview control?

When I use the drag and drop methods, and drop my node on a level I can drop it as the first child under that level or I can drop it as the first node at the same level.

IfI have 5 nodes under a level and want to drop another node in between nodes 3 and 4, it will only drop it before node 1.

Does anyone out there have any codes samples that they are using themselves to do this?

I have search the internet for samples and can not find one that does this.

Need Help Debugging Memory Leak Using APIs To View Treeview Node While Dragging
Hi all,

A long time VB hacker here.

This code is actually working with the first 7 drag and drops but stops working properly on the 8th attempt.

This is the least amount of code I've been able to find to:
View Treeview Node While Dragging.
AND works (well, kind of..) with mscomctl.ocx (v6)


I'm using Microsoft Windows Common Controls 6.0
in VB6 with SP5.

Any help in sorting this problem out and maybe cleaning this code up would be greatly appreciated.

Hopefully, other contributors will find this usefull as well.

Thanks,
Barry G. Sumpter

-----------

Note: This code uses the SetTimer API and exits VB if you stop execution while the timer is still enabled/running.

Only the form_load event code is mine. As well as the Debug.Prints

I've moved all the code that is in module from form1.
I just couldn't get anything to work otherwise. (I AM a hack )

-----------------------

Form1:
-----
Form1 Has 1 Treeview Control Named TreeView3
.....TreeView3 has Style set to 7 - tvwTreelinesPlusMinusPictureText
Form1 Has 1 ImageList Control Name ImageList1
.....ImageList1 which contains 4 16x16 icons with the Use Mask Color Ticked ON

-----------------------

Option Explicit


Public Sub DragComplete()

Debug.Print Now & "- " & "DragComplete"
'
' DragComplete
'
' Removes the drag image
'

' Stop the timer
KillTimer 0, m_lTimer

' End the image dragging
ImageList_EndDrag

' Destroy the ImageList
ImageList_Destroy m_lIL

End Sub


Public Sub TreeView_StartDrag( _
ByVal hWndTreeView As Long, _
Optional ByVal x As Long = 20, _
Optional ByVal y As Long = 20)


Debug.Print Now & "- " & "TreeView_StartDrag"


Dim tPoint As POINTL
Dim hItem As Long

' Get the selected node
hItem = SendMessage(hWndTreeView, TVM_GETNEXTITEM, TVGN_DROPHILITE, ByVal 0&)

' Get a ImageList with the drag image
m_lIL = SendMessage(hWndTreeView, TVM_CREATEDRAGIMAGE, 0, ByVal hItem)

' Start the image dragging
ImageList_BeginDrag m_lIL, 0, x, y
ImageList_DragEnter 0, 0, 0

' Start the timer
m_lTimer = SetTimer(0, 0, 1, AddressOf pvTimerDragMove)

End Sub


Private Sub TreeView3_OLECompleteDrag(Effect As Long)

Debug.Print Now & "- " & "TreeView3_OLECompleteDrag"

DragComplete

End Sub

Private Sub TreeView3_OLEStartDrag(Data As MSComctlLib.DataObject, AllowedEffects As Long)

Debug.Print Now & "- " & "TreeView3_OLEStartDrag"

' Stop the timer
KillTimer 0, m_lTimer

TreeView_StartDrag TreeView3.hWnd

End Sub
Private Sub Form_Unload(Cancel As Integer)

Debug.Print Now & "- " & "Form_UnLoad"

DragComplete

End Sub


Private Sub Form_Load()

Debug.Print Now & "- " & "Form_Load"

Dim nodx As Node

Set nodx = TreeView3.Nodes.Add(, , "R", "Root", 1)

Set nodx = TreeView3.Nodes.Add("R", tvwChild, "C1", "Child 1", 2)
Set nodx = TreeView3.Nodes.Add("R", tvwChild, "C2", "Child 2", 2)
Set nodx = TreeView3.Nodes.Add("R", tvwChild, "C3", "Child 3", 2)
Set nodx = TreeView3.Nodes.Add("R", tvwChild, "C4", "Child 4", 2)

Set nodx = TreeView3.Nodes.Add("C1", tvwChild, "C1-1", "Child 1-1", 3)
Set nodx = TreeView3.Nodes.Add("C2", tvwChild, "C2-1", "Child 2-1", 3)
Set nodx = TreeView3.Nodes.Add("C3", tvwChild, "C3-1", "Child 3-1", 3)
Set nodx = TreeView3.Nodes.Add("C4", tvwChild, "C4-1", "Child 4-1", 3)

Set nodx = TreeView3.Nodes.Add("C2-1", tvwChild, "C2-1-1", "Child 2-1-1", 4)

Set nodx = TreeView3.Nodes.Add("C3-1", tvwChild, "C3-1-1", "Child 3-1-1", 4)
Set nodx = TreeView3.Nodes.Add("C3-1", tvwChild, "C3-1-2", "Child 3-1-2", 4)

Set nodx = TreeView3.Nodes.Add("C4-1", tvwChild, "C4-1-1", "Child 4-1-1", 4)
Set nodx = TreeView3.Nodes.Add("C4-1", tvwChild, "C4-1-2", "Child 4-1-2", 4)
Set nodx = TreeView3.Nodes.Add("C4-1", tvwChild, "C4-1-3", "Child 4-1-3", 4)

Dim I As Integer

For I = 1 To TreeView3.Nodes.Count
Set nodx = TreeView3.Nodes(I)
nodx.EnsureVisible
Next

TreeView3.BorderStyle = vbFixedSingle

End Sub

-------------------------------------------------
Module 1
-----

Option Explicit

' ==== Public members ====
Public m_lIL As Long
Public m_lTimer As Long

' ==== API declarations ====

Public Declare Function ImageList_BeginDrag Lib "comctl32" ( _
ByVal himlTrack As Long, _
ByVal iTrack As Long, _
ByVal dxHotspot As Long, _
ByVal dyHotspot As Long) As Long

Public Declare Sub ImageList_EndDrag Lib "comctl32" ()

Public Declare Function ImageList_DragEnter Lib "comctl32" ( _
ByVal hwndLock As Long, _
ByVal x As Long, _
ByVal y As Long) As Long

Public Declare Function ImageList_DragLeave Lib "comctl32" ( _
ByVal hwndLock As Long) As Long

Public Declare Function ImageList_DragMove Lib "comctl32" ( _
ByVal x As Long, _
ByVal y As Long) As Long

Public Declare Function ImageList_Destroy Lib "comctl32" ( _
ByVal himl As Long) As Long

Public Declare Function ImageList_GetImageCount Lib "comctl32" ( _
ByVal himl As Long) As Long

Public Type POINTL
x As Long
y As Long
End Type

Public Declare Function GetCursorPos Lib "user32" ( _
lpPoint As POINTL) As Long

Public Declare Function WindowFromPoint Lib "user32" ( _
ByVal xPoint As Long, _
ByVal yPoint As Long) As Long

Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

Public Const LVNI_SELECTED = &H2
Public Const LVNI_DROPHILITED = &H8
Public Const LVM_CREATEDRAGIMAGE = &H1000& + 33
Public Const LVM_GETNEXTITEM = &H1000& + 12

Public Const TVM_CREATEDRAGIMAGE = &H1100& + 18
Public Const TVM_GETNEXTITEM = &H1100& + 10
Public Const TVGN_DROPHILITE = &H8

Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Public Declare Function GetWindowRect Lib "user32" ( _
ByVal hWnd As Long, _
lpRect As RECT) As Long

Public Declare Function KillTimer Lib "user32" ( _
ByVal hWnd As Long, _
ByVal nIDEvent As Long) As Long

Public Declare Function SetTimer Lib "user32" ( _
ByVal hWnd As Long, _
ByVal nIDEvent As Long, _
ByVal uElapse As Long, _
ByVal lpTimerFunc As Long) As Long

Public Sub pvTimerDragMove( _
ByVal hWnd As Long, _
ByVal uMsg As Long, _
ByVal idEvent As Long, _
ByVal dwTime As Long)


Dim tPoint As POINTL

' Get the cursor position
GetCursorPos tPoint

' Move the image to the new cursor position
ImageList_DragMove tPoint.x, tPoint.y

End Sub


-----------------

Thanks again ...

How To Locate A Node Item In Treeview?
Hi. I want to locate a node in treeview in runtime.
In listview, we can use:
lvdpur.SelectedItem=lvdpur.ListItems(i)
or in combobox, we can use Listindex.

but in treeview, no Listitems or Listindex can be used. So how to locate a node?

Thany you all.

How To Show Node Key On Treeview Tooltiptext?
When I roll my mouse over a node on a treeview, the tooltip shows the Text of the node. I want to show the key of the node in the tooltip. How can I do this?

Show The Node Text Along With The Drag Node.
During drag and drop of node in treeview control can I show the node text along with the drag node just like in Explorer window Please Help.

Show The Node Text Along With The Drag Node.
During drag and drop of node in treeview control can I show the node text along with the drag node just like in Explorer window Please Help

How To Set A TreeView With A Root Node That Does Not Show The Plus-minus
How to set a TreeView with a root node that does not show the plus-minus
signs but its children do?

Like this:

__________________________________
| | X |
---------------------------------------
|O Root Node Title |
||--+ Children |
||--- Children |
||---|---+SubChildren |
----------------------------------------

I hope you understand.

Select Treeview Node - Find In Db - Show In Listview
i use VB6, SQL SERVER 2k
i have a treeview with is populated from 3 tables using the code below
when i select a node i would like to feed a listbox with the appropriate data.
how can i find the correct record in the correct table in the db
when the node is selected.
all i can think of is by using the node.key but through my code i dont think this would be pretty much helpful.
is there a better way to populate my treeview, or a way to find the proper record in the proper table in the db?


Code:
' Add Node objects.
Dim nodX As Node ' Declare Node variable.

'root node
Set nodX = TreeView1.Nodes.Add(, , "root", "App.ProductName")

'tree structure
Set nodX = TreeView1.Nodes.Add("root", tvwChild, "child1", "Types")

Set rs2 = New ADODB.Recordset
rs2.Open "SELECT * FROM DevType", cn, adOpenKeyset, adLockOptimistic, adCmdText
'if types exist add them to structure
If rs2.RecordCount > 0 Then
Dim i
i = 1
rs2.MoveFirst
Do Until rs2.EOF
Set nodX = TreeView1.Nodes.Add("child1", tvwChild, "child1-" & i, rs2!Name)

Set rs3 = New ADODB.Recordset
rs3.Open "SELECT AppName,ApplicationID FROM DevApplication WHERE ApplicationID = (SELECT DISTINCT ApplicationID FROM DevVersions WHERE TypeID = " & rs2!TypeID & ")", cn, adOpenKeyset, adLockOptimistic, adCmdText
'if applications exist add them
If rs3.RecordCount > 0 Then
Dim k
k = 1
rs3.MoveFirst
Do Until rs3.EOF
Set nodX = TreeView1.Nodes.Add("child1-" & i, tvwChild, "child1-" & i & "-" & k, rs3!AppName)

Set rs4 = New ADODB.Recordset
rs4.Open "SELECT Name FROM DevVersions WHERE ApplicationID =" & rs3!ApplicationID, cn, adOpenKeyset, adLockOptimistic, adCmdText
'if application has versions add them
If rs4.RecordCount > 0 Then
Dim e
e = 1
rs4.MoveFirst
Do Until rs4.EOF
Set nodX = TreeView1.Nodes.Add("child1-" & i & "-" & k, tvwChild, "child1-" & i & "-" & k & "-" & e, rs4!Name)

e = e + 1
rs4.MoveNext
Loop
End If
rs4.Close
Set rs4 = Nothing

k = k + 1
rs3.MoveNext
Loop
End If
rs3.Close
Set rs3 = Nothing

i = i + 1
rs2.MoveNext
Loop
End If
rs2.Close
Set rs2 = Nothing

the tables structures in short, are
1. applications (name,idz,etc)
2. Types (aka. application types)
3. Versions (which relates the above two.)


thanxs in advance

TreeView Node Text Other App.
trying to retrieve nodes' text in a tree view object from a different application. I have manage to get the window handle of the object but do not know how to get the data in the tree view, class found is systreeview32.

Sending TreeView message using these functions and variables

Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
wParam As Any, _
lParam As Any) As Long ' <---

' ====================================================================== =====
' treeview definitions defined in Commctrl.h at:
' http://premium.microsoft.com/msdn/li...c/c67_4c8m.htm

Public Type TVITEM ' was TV_ITEM
mask As Long
hItem As Long
State As Long
stateMask As Long
pszText As String ' Long ' pointer
cchTextMax As Long
iImage As Long
iSelectedImage As Long
cChildren As Long
lParam As Long
End Type

Public Enum TVITEM_mask
TVIF_TEXT = &H1
TVIF_IMAGE = &H2
TVIF_PARAM = &H4
TVIF_STATE = &H8
TVIF_HANDLE = &H10
TVIF_SELECTEDIMAGE = &H20
TVIF_CHILDREN = &H40
#If (WIN32_IE >= &H400) Then ' WIN32_IE = 1024 (>= Comctl32.dll v4.71)
TVIF_INTEGRAL = &H80
#End If
TVIF_DI_SETITEM = &H1000 ' Notification
End Enum

' User-defined as the maximum treeview item text length.
' If an items text exceeds this value when calling GetTVItemText
' there could be problems...
Public Const MAX_ITEM = 256

' messages
Public Const TV_FIRST = &H1100
Public Const TVM_GETNEXTITEM = (TV_FIRST + 10)
Public Const TVM_GETITEM = (TV_FIRST + 12)

' TVM_GETNEXTITEM wParam values
Public Enum TVGN_Flags
TVGN_ROOT = &H0
TVGN_NEXT = &H1
TVGN_PREVIOUS = &H2
TVGN_PARENT = &H3
TVGN_CHILD = &H4
TVGN_FIRSTVISIBLE = &H5
TVGN_NEXTVISIBLE = &H6
TVGN_PREVIOUSVISIBLE = &H7
TVGN_DROPHILITE = &H8
TVGN_CARET = &H9
#If (WIN32_IE >= &H400) Then ' >= Comctl32.dll v4.71
TVGN_LASTVISIBLE = &HA
#End If
End Enum

This return the handle of TreeView
nLong= SendMessage(hWnd, TVM_GETNEXTITEM, TVGN_ROOT,
0&)

But the text is not return using
Dim tvi As TVITEM

' Initialize the struct to retrieve the item's text.
tvi.mask = TVIF_TEXT
tvi.hItem = hItem
tvi.pszText = String$(260, 0)
tvi.cchTextMax = 260
nChild = SendMessage(hWnd, TVM_GETITEM, 0, tvi)

but the tvi.pszText is always empty...

I want the name from which person is logon in the Yahoo Messenger window, that is found in treeview root node.

Any ideas

Get TreeView Node's Key From Text
Is there a way to get a Node's key by knowing it's Text? Thanks, Jeremy

Knowledge is the most powerful tool a person can obtain.

DeveloperKB

TreeView With Long Node Text
When I launch my application with a TreeView object in it, then load the nodes based on some data, some of the nodes have text that is larger than the frame the TreeView object is in. At first, when I 'hover' over those nodes, the full text appears, like a tooltip (which is what I want). But after the object loses focus, such as a message box, or change application, that 'feature' is gone, even when the focus is returned to the TreeView object the full text is just truncated and no 'hover' tip appears. I have found that removing the object and creating it again will bring back the 'hover' tip, but that is not acceptable. What do I need to do to get it back?

Disable Treeview Node Text
Hi , im looking for a way to disable the node text when this node have been drag and drop in a listview to be sure that the user won't take this node again. So if somebody has an idea, it would be very appreciate.

thanks
Mel

Edit Treeview Node Text
I am trying to edit the text of the parent node at then end of my formload. At the end it returns a number that I would like to be placed at the top, but I don't know it tell all the searching is done...

This is what I have:

Beg:

Set nodX = TreeView1.Nodes.Add(, , "u", "Total Profit: ", "FoldersOpen")

----Other code very long ---

end:

TreeView1.Node("u").Text = "Total Profit: " + FormatCurrency(TotalProfit)

I get a method or data member not found error

I am guessing it is talking about the .Node("u").text but I don't know what the name for the parent

Color Node Text In A TreeView
Is it possible?

If so, how?

Thanks!

How Do I Make TreeView Node Text Read-only?
I have a treeview on a form. However the user can still click on the node and the text becomes highlighted (like edit mode) and whatever is typed in now becomes the text of the node. How can I disable this?
Thanks

"The answer is out there, Neo, it’s looking for you. And it will find you, if you want it to."--Trinity to Neo

Displaying Selected Treeview Node Text In Textboxe(s)
Hi guys

Could someone that "knows how" have a look at the attachement and show me how I can display the selected nodes in the txtboxes when loading frmAddSupplier.

Thanks
Pieter

Treeview - (un)check All Children Node If Parent Node Is (un)checked
Hi guy,

I have a treeview where I want to automaticly checkuncheck all the children of a parent node when the parent node is checked/unchecked. For this purpose I thought up the following code:


Code:
Private Sub Treeview1_NodeCheck(ByVal CheckedNode As MSComctlLib.Node)

For Each Node In Treeview.Nodes

If Node.Parent = CheckedNode.Key Then
Node.Checked = CheckedNode.checked
End If

Next

End Sub

But this gives me an error saying : "Object Variable or blockvariable With not set" (I had to translate the error so maybe it could be slightly different in english)... I can't think of anything that is wrong in the code, and I can't find a codesnippet that tells me otherwise, so what is causing the error?

Changing Text On A Treeview Item
How would you change the text on and existing treeview item? I have a parent Item named "files" with text "Files (0 Files)". When a files is added as a child I would like it to read "Files (1 Files)" or what ever number after more files are added.

Select An Item From A Combo Box And Show A Field In A Text Box
How can I display a field in a text box by selecting this field from a combo box. More simply, I have a DB MSACCESS in this db I have a table in this table I have two fields. One field I populate in a combo box, but the second I need to display in a text box. Any time when I select any data from combo box I need to show the second field in a text box. I have this code

Dim dbs as Database
dim rs as RecordSet

Set dbs = Opendatabase("Products")
Set rs = dbs.OpenRecordset("ProdCode", dbOpenDynaset)

Do until rs.EOF
Combo1.AddItem Format (rs!StockNo)
text1 = rs!Product
rs.MoveNext
loop

The code populate de combo, but when I select an Item from the combo doesn't show me the data in the text box. Thank you for your help and support.

Manny

Menu Item Dragging
One facility that Windows provides with certain menus is the ability to drag and drop items in them to different positions so that the user can re-order them (see for instance the Favorites menu in Internet Explorer and the Programs menu in the Start menu). So what if you want to have this sort of facility in your VB application? Can it be done?

The answer is yes, although clearly it can't be done with native VB, and it does in fact require subclassing of two separate windows. The attached project provides a demonstration of how it can be done. It emulates the design used in Windows 98, which is to have a bar appear over the menu to show where the menu item being dragged will be dropped. I have not explored emulating the design used in Windows XP, which is to have a translucent copy of the menu item being dragged appear as a drag icon, but no doubt the technique to do this would be similar, if more advanced.

The stages to allowing menu item dragging and dropping are:

1. Subclass the form that contains the menus. You will need to be comfortable with the concept of subclassing in order to understand the project. If you're not, try this thread by John.

2. In the subclassing routine for the form (WindowProc of SubClassForm), set the menus to be ownerdrawn. Code for this is courtesy of Garrett Sever at EliteVB .

3. Obtain the hwnd of the menu window. This is NOT the same as the handle to the menu, which all APIs to do with menus seem to use. Instead it is the handle to a window that contains the menu. You could get this through looking for the WM_ENTERIDLE message in the form subclassing routine, which gives it to you, although I do it by waiting until the first item in the menu is drawn, and then finding it with FindWindow.

4. Subclass the menu window. This is the key to the whole thing. All of the following steps are carried out in the menu window subclassing routine (MWProc of SubClassMenuWindow). The form subclassing routine does not give you sufficient messages to provide for menu item dragging, so you have to do this.

5. When the left mouse button goes down on the menu (MWM_MOUSEDOWN, MWM_MOUSEDOWNWIN98 messages), record where it does.

6. If the mouse moves (MWM_MOUSEMOVE message) outside the drag rectangle without coming up, begin a drag operation. Get a device context for the menu window, and draw a bar onto that device context to show where the menu being dragged will be dropped if the user releases the left mouse button.

7. When the left mouse button comes up (MWM_MOUSEUP, MWM_MOUSEUPWIN98 messages), don't call the original window procedure. Instead, re-arrange the data which your menus represent, and cause the menu window to be refreshed by use of InvalidateRect. This allows the user to see the changes that he has made before the menu is dismissed.

And that's about it. It is complicated, and it is otherwise undocumented so far as I can see, but it does work. If you have any comments or find any bugs then please PM me.

Listview Dragging Item
Hello, Jusk asking if there is a possible way to drag item in the listview??

it goes like this:

Listview populate with;

Item 1
Item 2
Item 3

When I drag Item 3 to the position of Item2, it goes like this;

Item 1
Item 3
Item 2


is this possible?? if not?? what should I do??

If I Add An Item Onto A Form, How Do I Go About Dragging It Around?
I been searching on these forums but cant find anything using VB 6

Show Contents While Dragging
Hello!

Could somebody help me? I have some picture box on a VB form. When I drag this object, I see only one gray rectangle. I want to see picture box's contents while drag it.

How Can I Loopt Through Node And Add Add Node Text To Combos Avoiding Duplicates
Hi

I have
a treeview and 2 combo box cboMonth and cboYear


 + Nodeshow (node parent)
                     
       01/09/03 (dates node child)
       02/09/03 (dates node child)
       03/10/03 (dates node child)
       04/10/03 (dates node child)

I need a routine that loops through the nodeShow and adds all the months in the nodeShow to the cbomonth and all the years to cboyear (avoiding duplicates)

Has anybody done that?

thanks
vbnetuk

       


 
     

Show Window Content While Dragging
This isn't much help, but it's GOT to be in the registry. I've looked
for about 15 minutes and can't find it, but every other thing in the
world is in there.


FWIW -- I couldn't find an API for it either.

If you CAN find the registry entry, it should be fairly simple to
save the value to a variable, change it to the mode that allows
the skimming, and re-set it after you're done.


HTH

How Do You Show The Windows Contents While Dragging?
How do you show the windows contents while dragging? (ie like old winamp) you click and drag while still seeing the contents of the window.

[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

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!

Dragging And Dropping Outside Of A Treeview
I am attempting to create an application where a treeview has a hierarchal display of data, and the user can drag any item from the treeview to a textbox which is used to create a script.

My problem is this:

Say the root node is currently selected. When the user grabs an item which is not the root node, and drags it to the textbox, the root node is the only thing that gets moved.

If the user first clicks on the item (going through all mouse_down, mouse_up and node_click events) and then clicks and drags, it works fine.

But I'd like it so that the user doen't have to click twice (dragging with the second click) to drag an item outside of the treeview.

If the user drags the item around inside the treeview, the newly clicked node remains selected. But drag it out of the treeview and BAM! The originally selected node becomes selected again.

Any thoughts?

Thanks.

Dragging Items In A Treeview Between Itself
I've got a tree view control in my application and i need to drag its children nodes between the parent nodes. I.e you can be able to change the parent node just by dragging a node from one parent node to anotehr. Is this possible to be done by native VB, or does it need some API involveD?

I've seen several applications using this functionality. Any idea how i can solve this problem?

Thanks!

Click Item In Listview Then Show That Item In Combo As Index = 0
Hi guys,

I have a listview (lvwUserPunchedOut) that is populated with records in a database (persons first name in one column and last name in the second column), what I am looking to do is if I select a persons name by clicking on it in the listview on frmMain, and then bring up frmSearchCriteria, i would like to show that selected name in the combobox as default (cboEmployee.ListIndex = 0) on frmSearchCriteria (the combobox is sorted = True and is also populated with first name and last name of the person)

How would this be done? Hope I make sense. Thanks in advance.

Stop Item Dragging/moving In ListView
Is there any way you can stop the user from moving the item position in a listview?? I need them to stay the same as i added them first by code, with them being fixed for the user and not allowing any movement of item position!

thanks!

XML Node As Treeview Node/Tag
Hi.

I'm looking to store a reference to an xml node in the Tag of a tree view node.

I can't store the actual text etc because the i need the to be able to edit the xml sub nodes in place.

I'm thinking a can store the the memory address (via ObjPtr) as the treeview node tag, but does anyone know to do the reverse (i.e. get object from a given memory address) ?



td.

Dragging With The Treeview (not Very Hard, Honest)
i have a form with a treeview and listview that lets you drag items from the treeview to the listview. however, it should only let you drag child items from the treeview, so i have this code:


VB Code:
Private Sub tvwHeaders_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)    If (Button = vbLeftButton) Then        If (tvwHeaders.SelectedItem.Parent Is Nothing) Then Exit Sub                tvwHeaders.DragIcon = tvwHeaders.SelectedItem.CreateDragImage        tvwHeaders.Drag vbBeginDrag    End IfEnd Sub Private Sub lvwSubHeaders_DragDrop(Source As Control, x As Single, y As Single)    On Error GoTo ErrHandler        If (Source Is tvwHeaders) Then        lvwSubHeaders.ListItems.Add , Source.SelectedItem.Key, Source.SelectedItem.Text, 1    End If        Exit Sub    ErrHandler:    If (Err.Number = 35602) Then        MsgBox "You have already included this list.", vbInformation, "Cannot Add List"    End IfEnd Sub


if you click a child item, then click a parent item, release the mouse button, click again and drag, it won't let you move it (good). however, if you click a child item, release the mouse button, click a parent item (without releasing the mouse button) and drag, it'll drag the parent item (bad). if that makes any sense to you, is there any way i can prevent that?

Scroll The Treeview When Dragging And Dropping
The only information that I can find on scrolling a treeview when dragging and dropping a node is out on microsoft's support online - Article ID: Q177743

http://support.microsoft.com/suppor...s/q177/7/43.asp

The problem that I am having with is solution is that when the mouse button is released over an area other than the treeview area, it continues to scroll. It does not recognize that the mouse button has been released. It also continues to scroll is you drag it off the form, which microsoft applications do not do.

Does anyone have a fix for this or possibly a better solution?

Dragging Items In A Treeview In Itself (changing Locations)
I need to perform a drag-drop function on a treeview control in which the user can move items between different nodes of the tree.

I need to implement this functionality via dragand drop, so as to make it easy to interact. Is this possible? Do i need to go into detailed API or wiht native VB it is possible?

Any ideas? Thanks a lot ppl

Code To AutoScroll Treeview When Dragging And Dropping
Hi Guys,

I need code to autoscroll my treeview whenever I drag and drop an item. Please help me.

Treeview: Dragging And DoubleClicking (harder Then It Sounds)
Hello,

I got a little problem wih my treeview. I want the user to be able to Drag some items and double click on some items. They both work,but the only problem is when you doubleclick on an item (should be quite fast and it doesn't always happens) then it look likes you want to drag what is quite annoying.

Is there anyone who could fix this??

Thanx in advance

Dragging A Record In Datagrid Into TreeView Control
Dear All
is it possible for us Drag a record and then drop into a Treeview control on the same screen ? If yes,,,HOW

Urgent ! Pls Help

TIA

regard
Jason

Open Node && Close Already Open Node In TreeView!
Suppose my TreeView looks like this:


Code:
Asia
|_____India
|_____Mumbai

|_____Pakistan
|_____Karachi

|_____Japan
|_____Tokyo

|_____China
|_____Beijing


Assume that all the nodes are closed. I open India; Mumbai can be seen. Keeping India open, I then open Japan; Tokyo can be seen. What I want is when I open Japan, India which was already open should get closed i.e. at any time, only 1 node should remain open. How do I do this?

Adding A Child Node To A Child Node In A TreeView
Does any one know what the Syntext "Coding" is to

add a child to a child node

In a TreeView ?



Edited by - Malan on 7/1/2004 2:25:03 PM

TreeVIew Node Id
i would like to give an id to my node I tried keys and tag without any sucess.
I want to identify them so i can sort them (I want to know who is Parent and who is child) anyone go an idea?!

Getting First And Last Node In The Treeview
how can i get the first item (that appears to be first) or the last item in the treeview?

TreeView.Nodes(1) does not work, or treeview.nodes(treeview.nodes.count).

Because if i enter a node before 1, by doing Add and making it a tvwprvious relationship to it, the "first" node will still have index of 1, and the "new" node will not have 1!

how can it be done?

thanks!

Treeview Node
Hi
I have a treeview inside my form.Upon clicking on a node,I want to display the text of this node in a label
How can I do it?

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