Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How to call Node Click in Procedure

Posted on 2002-05-28
Medium Priority
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 600 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?
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

715 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