Click here to Skip to main content
16,017,944 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: find word editor using API Pin
MohammadAmiry28-Jun-05 4:21
MohammadAmiry28-Jun-05 4:21 
GeneralRe: find word editor using API Pin
Anonymous28-Jun-05 17:15
Anonymous28-Jun-05 17:15 
GeneralRe: find word editor using API Pin
Dave Kreskowiak29-Jun-05 0:40
mveDave Kreskowiak29-Jun-05 0:40 
Generaltreeview control question Pin
aimar_2027-Jun-05 22:05
aimar_2027-Jun-05 22:05 
GeneralRe: treeview control question Pin
Anonymous27-Jun-05 22:40
Anonymous27-Jun-05 22:40 
GeneralRe: treeview control question Pin
aimar_2027-Jun-05 22:52
aimar_2027-Jun-05 22:52 
GeneralRe: treeview control question Pin
Dave Kreskowiak28-Jun-05 2:40
mveDave Kreskowiak28-Jun-05 2:40 
GeneralRe: treeview control question Pin
aimar_2028-Jun-05 5:14
aimar_2028-Jun-05 5:14 
Thanks for you reply, but I don't understand very well.

Can you post me the code, please? I have been proving the following thing that I see in this project: http://www.codeproject.com/cs/miscctrl/favoritescontrol.asp[^]

This project are in csharp and I convert some parts to vb.net

Now, I have this

First, one declaration of two points

Private _intX As Integer = 0
Private _intY As Integer = 0

Second, in the click event:

Private Sub CatalogTree_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CatalogTree.Click
Dim objTreeView As TreeView = CType(sender, TreeView)
Dim objNode As TreeNode = objTreeView.GetNodeAt(_intX, _intY)
Dim CurrentNode
Dim CurrentNodeName
Dim CurrentNodeRaiz

If Not objNode Is Nothing Then
If Not objNode.Tag Is Nothing Then
'A URL was clicked
CurrentNode = objNode.Tag
CurrentNodeName = objNode.Text
'RaiseEvent URLClick(Me, New System.EventArgs)
Else
'A folder node was clicked
CurrentNodeRaiz = objNode.Text
'Collapse all sibling nodes so only one folder is open at any given level
_CollapseSiblings(objNode)
'Toggle the folder
If Not objNode.IsExpanded Then
objNode.Expand()
Else
objNode.Collapse()
End If
End If
End If

End Sub

Third, in the mousedown event

Private Sub CatalogTree_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles CatalogTree.MouseDown
_intX = e.X
_intY = e.Y
End Sub

and finally, one method for collapse nodes

'By Sergio
Private Function _CollapseSiblings(ByVal aobjNode As TreeNode)
Dim objNode As TreeNode = aobjNode.PrevNode
While Not objNode Is Nothing
objNode.Collapse()
objNode = objNode.PrevNode
End While
objNode = aobjNode.NextNode
While Not objNode Is Nothing
objNode.Collapse()
objNode = objNode.NextNode
End While
End Function

The link of the project that I have seen works good.
But the code that I post don't collapse any node.

What I can do?
GeneralRe: treeview control question Pin
Dave Kreskowiak28-Jun-05 5:31
mveDave Kreskowiak28-Jun-05 5:31 
GeneralRe: treeview control question Pin
aimar_2028-Jun-05 5:41
aimar_2028-Jun-05 5:41 
GeneralBest place to load a control Pin
peepys27-Jun-05 21:59
peepys27-Jun-05 21:59 
GeneralRe: Best place to load a control Pin
toxcct28-Jun-05 0:32
toxcct28-Jun-05 0:32 
Generalprint a form Pin
Anonymous27-Jun-05 21:32
Anonymous27-Jun-05 21:32 
GeneralTo know who are open my file tru LAN Pin
vincentkhoosiongleng27-Jun-05 21:32
vincentkhoosiongleng27-Jun-05 21:32 
GeneralRe: To know who are open my file tru LAN Pin
Dave Kreskowiak28-Jun-05 2:34
mveDave Kreskowiak28-Jun-05 2:34 
GeneralRe: To know who are open my file tru LAN Pin
vincentkhoosiongleng28-Jun-05 3:44
vincentkhoosiongleng28-Jun-05 3:44 
GeneralRe: To know who are open my file tru LAN Pin
Dave Kreskowiak28-Jun-05 4:11
mveDave Kreskowiak28-Jun-05 4:11 
GeneralRe: To know who are open my file tru LAN Pin
vincentkhoosiongleng28-Jun-05 13:37
vincentkhoosiongleng28-Jun-05 13:37 
GeneralRe: To know who are open my file tru LAN Pin
Dave Kreskowiak28-Jun-05 15:20
mveDave Kreskowiak28-Jun-05 15:20 
GeneralRe: To know who are open my file tru LAN Pin
vincentkhoosiongleng28-Jun-05 16:57
vincentkhoosiongleng28-Jun-05 16:57 
GeneralMethod hiding!! Pin
myousufq27-Jun-05 21:00
myousufq27-Jun-05 21:00 
GeneralRe: Method hiding!! Pin
Christian Graus27-Jun-05 21:07
protectorChristian Graus27-Jun-05 21:07 
Generaloverloading .net control's property Pin
peepys27-Jun-05 17:28
peepys27-Jun-05 17:28 
GeneralRe: overloading .net control's property Pin
Christian Graus27-Jun-05 18:14
protectorChristian Graus27-Jun-05 18:14 
GeneralTable Control Pin
Member 207770627-Jun-05 13:01
Member 207770627-Jun-05 13:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.