473,386 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

SendMessage mouse click to treeview node

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
1 5047
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Remi Hugnon | last post by:
Hi, I want to build an expandable treeview. I saw some code on VB but I know only C# I plan for my class that each nodes has its own id (using span for example). Into a single aspx page...
3
by: **Developer** | last post by:
I need to know when the mouse is over the text of a TreeView node. I know how to get the Bounds of the node which appear to be the correct values to delineate the text. I could check the mouse...
3
by: iwdu15 | last post by:
hi, the treeview only selects a tree node when clicked with the left mouse button...how can i get it to select a node with the right mouse button? thanks -- -iwdu15
1
by: MrNobody | last post by:
by default when you right click a tree the control selects the node if you add a right-click event (so that I can put sepearate ContextMenus depending on what type of node the user clicked on)...
1
by: weird0 | last post by:
i have detected the event of treeview node mouse click. All i want is that when a user clicks, a menu appears. How can i create a menu? Not the static one, that appears on the top. The one that...
1
by: selvakumari | last post by:
Hi, i am new to C#, i have a multiselection treeview, where if i select a nodes with ctrl and shift corresponding nodes will be copied to another treenode, i want to unselect the childnode...
2
by: selvakumari | last post by:
Hi, i am new to C#, i have a multiselection treeview, where if i select a nodes with ctrl and shift corresponding nodes will be copied to another treenode, i want to unselect the...
7
by: Barkingmadscot | last post by:
I am try to find out how to check if the mouse button is held down. The e.click =2 works, it allows me to enter the double click double. I what the single click to do some different and then...
2
by: govolsbaby | last post by:
Hi All I've got a treeview with checkboxes. I want the user to be able to toggle the checkbox by click on the checkbox OR by clicking on the node text. So I've added an afterselect event...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.