Solved

How to call Node Click in Procedure

Posted on 2002-05-28
6
187 Views
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
---------------
root
|
---child
   |
   ----child1

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
0
Comment
Question by:GautamMukherjee
[X]
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
6 Comments
 
LVL 143

Accepted Solution

by:
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))

CHeers


0
 
LVL 4

Expert Comment

by:gencross
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.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
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?
0
Industry Leaders: 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!

 
LVL 4

Expert Comment

by:gencross
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)
0
 
LVL 16

Expert Comment

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

Author Comment

by:GautamMukherjee
ID: 7046596
Thanx for the answer.

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

749 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