By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,915 Members | 1,341 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,915 IT Pros & Developers. It's quick & easy.

SendMessage mouse click to treeview node

P: n/a
Hi,

I would like simulate a mouse click on on of my treeview nodes when my
form opens.

for that i was thinking to use the same simple way as under C++ :
SendMessage(TreeView.Nodes[0].Handle, WM_LBUTTONDOWN,0,0);

but it does not work. i do not get any error message and application
runs normally... just my first node is not selected (clicked).

i want to do that because like that, another childform will be selected
based on my treeview node clicked.

thanks a lot,

RAF
Nov 24 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 24 Nov., 15:47, "R.A.F." <noem...@nospam.comwrote:
Hi,

I would like simulate a mouse click on on of my treeview nodes when my
form opens.

for that i was thinking to use the same simple way as under C++ :
SendMessage(TreeView.Nodes[0].Handle, WM_LBUTTONDOWN,0,0);

but it does not work. i do not get any error message and application
runs normally... just my first node is not selected (clicked).

i want to do that because like that, another childform will be selected
based on my treeview node clicked.

thanks a lot,

RAF
Maybe I'm missing something here, but if you want to make sure that
that a specific node is selected when your form opens, why not simply
set the SelectedNode property of the tree?
Since the most common way to use a tree for navigation is to handle
the AfterSelect event, this should result in the same behavior as
actually clicking on the node.

hth,
Kevin Wienhold
Nov 26 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.