473,666 Members | 2,728 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to: Implement "Click" event in a TreeView Control using .Net C

I would like to implement the following functionality:

When a user taps a (child) treeNode, an event fires which allows me to get
the selected treeNode's TAG object, determine it's values, and then load a
new form based on those values...

Intellisense shows the "Click" event, however, this does nothing. (I assume
it's not supported in .Net CF?) I see via Design Mode in VS 2003 that the
only feasible event is "AfterSelected" . This, however, seems to loop through
all of the the treeNodes. I have to implement some sort of "hack" to avoid
this....

Any ideas on how to make the above happen?

Thanks,
Nov 16 '05 #1
1 1769
To further my original question, i've run into another problem: Using the
AfterSelect event, this event runs through all of the nodes. I had thought
that i can cancel this event via the TreeViewCancelE ventArgs class, however,
i cannot manage to make this work. Reading "Consuming Events" via MSDN
Library seems quite involved, and slightly beyond my understanding. Can
someone provide an example on how to make this event "cancel".

Currently, when the AfterSelect event loops though nodes which have not been
selected, i "avoid" exit the event by testing:

if (e.Action ==TreeViewActio n.Unknown) return;

This, nevertheless, does not avoid the fact that the event contnues to loop
through all nodes....

Thanks,

"charliewes t" wrote:
I would like to implement the following functionality:

When a user taps a (child) treeNode, an event fires which allows me to get
the selected treeNode's TAG object, determine it's values, and then load a
new form based on those values...

Intellisense shows the "Click" event, however, this does nothing. (I assume
it's not supported in .Net CF?) I see via Design Mode in VS 2003 that the
only feasible event is "AfterSelected" . This, however, seems to loop through
all of the the treeNodes. I have to implement some sort of "hack" to avoid
this....

Any ideas on how to make the above happen?

Thanks,

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1802
by: Al Christoph | last post by:
I have a program that mixes wizard like behavior with random access to the various dialogs in the wizard. I do this by having each step map to a toolstripmenuitem. Users can randomly choose the menu item and get the corresponding dialog. Alternatively at the completion of each dialog, I can "click" on the menu item and cause the appropriate dialog to come up. It works rather well but the way I've done it is a horrible kludge. I even left...
7
14449
by: charliewest | last post by:
Using .Net Compact Framework, I have an ImageButton control (derived from the Button control) this is wired to a click event. The click event's receives the standard arguments (sender, e). How is it possible from within the click event function to get the "name" property of the control? For example: ImageButton ImageButton1 = new ImageButton(); ImageButton1.Click += new System.EventHandler(ImageButton1_Click); .... code private void...
2
1577
by: Sakharam Phapale | last post by:
Hi All, I am working on a project, where maximum operations carried out on Files and multi-dimensional arrays. Since array data is huge application takes too much memory. My problem is, after few operations, toolbar on MDI from doesn't catch "Click" event. But it catch all other events like mouse leave etc.
2
2776
by: Nikki | last post by:
Hi, I m developing a Windows application in which i want to create a context menu, having variable number of submenus depending on the the list in the file. I m able to create these submenus at runtime by reading the file. But the problem is that there is no fixed count of submenus and becaz of that i m not able to figure out "How to create click event handler dynamically for each submenuitem"? Please help. Thanks, Nikki
2
2048
by: Stephen Lambie | last post by:
Hi, I want to develop a custom checkbox. I want to use the existing checkbox in a custom control where I use the disabled state as a third state. I need to be able to detect mouse or click events in the disabled checkbox or the parent custom control. Is this possible? How does a control like a button control implement event trapping like a click event?
41
4288
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based on some initialization information obtained elsewhere. Basically, I'm going to create my own dynamic toolbar where the toolbarbuttons can change. I'm not using the VB toolbar because of limitations in changing things like backcolor (I can't get...
2
1792
by: semesm22 | last post by:
is there any way that i can create a click event for a label that is part of the web control library....i want to use a label in a user control, and when the user clicks one the user control i wanna change the color of the label to red for example....i tried importing system.web.ui.webcontrol.label but there is no click event for the label, so is there a way i can create it thanks sam
2
4844
by: Serious_Practitioner | last post by:
Good day, and thank you in advance for any assistance. I'm having trouble with something that I'm trying for the first time. Using Access 2000 - I want to run a function either on the click of a button or on leaving a text box. For the immediate task, either will work as well as the other. I think. I'm just at the beginning of this, and the form has two text boxes - Text0 and Text1. The user input to Text0 is a dollar amount, in...
2
3502
by: techsatish | last post by:
Hi, I want the double click event to call(here not able to get the MouseEventArgs) and execute the mouseup event code or any one tell me how to make my treecontrol double click nodes to behave like a singe click event(that is mouseup here)so that that will fire mouseup.How can i implement this?any ideas ? code snippets? Thanks in advance satish
0
8438
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8348
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8863
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6187
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4356
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1761
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.