|
-
Mar 3rd, 2006, 02:12 AM
#1
Thread Starter
Member
Why can't the treeview function?? Please Help
VB Code:
Private Sub TreeView1_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
If strKEy <> "" Then
If TreeView1.Nodes(strKEy).Parent Is Nothing Then
If Button = 2 Then ' if the mousebutton 2 is pressed (right)
PopupMenu rclick ' then it calls the menu which is hidden to be shown
' at the cordinates of the mousepointer (x,y)
Else
Button = 1
RemoteHost = TreeView1.Nodes(strKEy).Text
sckControlPanel.RemoteHost = RemoteHost
sckControlPanel.RemotePort = 8005
sckControlPanel.Connect
End If
End If
Else
sckControlPanel.Close
Call sckControlPanel_Close
End If
Data1.Refresh
End Sub
This is the code i used in the treeview but i all the function which i put in can't function for example the right click pop up or even the left click to make the connection can;t even work. Please can anyone help me..
Thanks alot in advance
Last edited by Hack; Mar 3rd, 2006 at 01:12 PM.
Reason: Added [vbcode] [/vbcode] tags and for more clarity.
-
Mar 3rd, 2006, 07:54 AM
#2
Re: Why can't the treeview function?? Please Help
What happens when you try?
Are you getting error messages? If so, what are they and on what line to they occur?
-
Mar 3rd, 2006, 01:08 PM
#3
Thread Starter
Member
No nothing is happening...
The problem is nothing is happening... No error message or anything.. i can click but nothing is happening. Anyone have any idea?? Please help me ok Thanks in advance...
-
Mar 3rd, 2006, 01:13 PM
#4
Re: Why can't the treeview function?? Please Help
Put a break at the beginning of the sub and using F8 "walk" through it to see what is happening.
-
Mar 3rd, 2006, 01:21 PM
#5
Re: Why can't the treeview function?? Please Help
 Originally Posted by tauhu82
VB Code:
Private Sub TreeView1_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
If strKEy <> "" Then
If TreeView1.Nodes(strKEy).Parent Is Nothing Then
If Button = 2 Then ' if the mousebutton 2 is pressed (right)
PopupMenu rclick ' then it calls the menu which is hidden to be shown
' at the cordinates of the mousepointer (x,y)
Else
Button = 1
RemoteHost = TreeView1.Nodes(strKEy).Text
sckControlPanel.RemoteHost = RemoteHost
sckControlPanel.RemotePort = 8005
sckControlPanel.Connect
End If
End If
Else
sckControlPanel.Close
Call sckControlPanel_Close
End If
Data1.Refresh
End Sub
This is the code i used in the treeview but i all the function which i put in can't function for example the right click pop up or even the left click to make the connection can;t even work. Please can anyone help me..
Thanks alot in advance
Also make it easier on yourself (or the guy who needs to maintain your code) and indent!
-
Mar 3rd, 2006, 02:36 PM
#6
Re: Why can't the treeview function?? Please Help
Is option explicit enabled?
-
Mar 3rd, 2006, 03:08 PM
#7
Re: Why can't the treeview function?? Please Help
Where do you set the value of strKey?
-
Mar 4th, 2006, 09:33 AM
#8
Thread Starter
Member
Re: Why can't the treeview function?? Please Help
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
strKEy = Node.Key
End Sub
Private Sub TreeView1_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
If strKEy = "" Then
If TreeView1.Nodes(strKEy).Parent Is Nothing Then
If (Button = vbRightButton) Then ' if the mousebutton 2 is pressed (right)
'PopupMenu rclick ' then it calls the menu which is hidden to be shown
' at the cordinates of the mousepointer (x,y)
Else
Button = vbLeftButton
RemoteHost = TreeView1.Nodes(strKEy).Text
sckControlPanel.RemoteHost = RemoteHost
sckControlPanel.RemotePort = 8005
sckControlPanel.Connect
End If
End If
Else
sckControlPanel.Close
Call sckControlPanel_Close
End If
Data1.Refresh
End Sub
Private Sub Form_Activate()
On Error Resume Next 'just to make sure run-time error will not occur
strKEy = TreeView1.SelectedItem.Key
On Error GoTo 0
End Sub
Yes the option explicit is already enable. If anyone can help me please do so Thanks alot inadvance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|