How to call Node Click in Procedure

Posted on 2002-05-28
Last Modified: 2008-01-09
I want a solutions for Calling the NodeClick Function in some procedure.

I am using treeview control, i want to call NodeClick in other procedure, when i click on the node it automatically works but the problem is when i calling that NodeClick fucntion in some procedure i am unable to pass a node value.

tree structure

if possilbe plz tell me how to call nodeclick in some other procedure for "Child1"

eg :
Private Sub TreeMenu_NodeClick(ByVal Node As MSComctlLib.Node)
  msgbox "Hi"
end sub
Question by:GautamMukherjee
LVL 142

Accepted Solution

Guy Hengel [angelIII / a3] earned 200 total points
ID: 7038932
You have 2 situations:
* is Child1 the selected (active) node:
  Call TreeMenu_NodeClick(treeMenu.SelectedItem)

* otherwise, you have to get the reference to the node, either by key or by index:
  Call TreeMenu_NodeClick(treeMenu.Nodes(indexorkey))



Expert Comment

ID: 7039138
If your procedure is in a different module than the TreeMenu you must also change the NodeClick from Private to Public.

Hope this helps.
LVL 16

Expert Comment

ID: 7040099
"If your procedure is in a different module than the TreeMenu you must also change the NodeClick from
Private to Public.
sorry,... what?
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.


Expert Comment

ID: 7040127
Richie, I will clarify....

If you have a BAS module with a procedure in it...

Sub CallNodeClick()
    Call Form1.TreeView1_NodeClick(Form1.TreeView1.SelectedItem)
End Sub

This will not work...

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)

This will...

Public Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
LVL 16

Expert Comment

ID: 7040277
this is the first time i heard that :0

Author Comment

ID: 7046596
Thanx for the answer.


Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Computer crashes, following error message in event manager 5 199
SQL VB connection works in one PC and doesn't in another 15 64
Advice in Xamarin 21 79
RUNRMTCMD from AS/400 12 47
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question