473,387 Members | 3,684 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,387 software developers and data experts.

TreeView Double Click Event Strange Problem

Hello,
I have a tree view which has Check Box's beside each node.
In the BeforeCheck event Handler I have canceled the event to
prevent the user from Checking/ Un-checking the box:
private void treeView3_BeforeCheck(object sender, TreeViewCancelEventArgs e)
{
e.Cancel = true;
}
I am trying to now set up the DoubleClick event but the first time
the user double clicks the event is not called. For example the first
time clicked it will expand/Collapse the node but the event will not be
called. Every time after that it works correctly.
All I am doing currently is doing a Console.WriteLine();
private void treeView3_DoubleClick(object sender, EventArgs e)
{
Console.WriteLine("Double Click Invoked");
}
A co-worker also has a similar problem with right clicking to bring up
a context menu. The first time it does not work then every time after
that it works as expected.

The following is under the InitializeComponent();

this.treeView3.DoubleClick += new
System.EventHandler(this.treeView3_DoubleClick);

this.treeView3.BeforeCheck += new
System.Windows.Forms.TreeViewCancelEventHandler(th is.treeView3_BeforeCheck);

This Problem occurs every time the tree view is repopulated, Which is
simply done by clicking a button.

Any ideas would is appreciated.
-Navid-
Sep 16 '08 #1
0 1638

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

Similar topics

6
by: Brian Smith | last post by:
Is there a way to avoid the default action of TreeNode expansion/contraction caused by double click? I can add an event handler to pop up my properties dialog on double click, but it has the...
7
by: Michael C | last post by:
Hi all, I half-resolved my previous TreeView issue. Now I was wondering if anyone knows of a way to keep a TreeNode from being highlighted when it is left-clicked? It seems like there should...
1
by: Aleksey | last post by:
Hi, All! I have a problem with TreeView component. My TreeView consists of two nodes Node1 and Node2. On click of right mouse button TreeView has event. In this event I check wich node is...
14
by: Evan Kontos | last post by:
I am trying to implement a Treeview w/an XML file and I even copied and pasted examples from MSDN but can't get them to work. Any suggestions welcome. XML File <TREENODES> <TREENODE...
17
by: Spam Trap | last post by:
I am upgrading from VB6 where I had access to a treeview NodeClick event (see below)... but now VB.NET does not have this any more. Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)...
3
by: Shawn | last post by:
Hi. I'm working with the TreeView control in my ASP.NET 1.1 application. I have a problem I haven't been able to figure out. When I click on a node (not expand), whether it's a parent node, a...
4
by: John Dann | last post by:
I'm trying to implement a fairly simple Treeview procedure but running into problems. My Treeview has just two levels of nodes: top-level and one child level. I want a doube-click on the...
2
by: celoftis | last post by:
Using VS2005, ASP.NET. Check out the tree view on this page: http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.treeview.aspx When you hover over the border between the two...
5
by: Peter Duniho | last post by:
On Sat, 27 Sep 2008 12:02:04 -0700, <timor.super@gmail.comwrote: You don't, not when you don't know that one event is necessarily going to follow another. If the events can appear alone, then...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.