471,342 Members | 1,994 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,342 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 1496

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Brian Smith | last post: by
7 posts views Thread by Michael C | last post: by
1 post views Thread by Aleksey | last post: by
14 posts views Thread by Evan Kontos | last post: by
3 posts views Thread by Shawn | last post: by
4 posts views Thread by John Dann | last post: by
2 posts views Thread by celoftis | last post: by
5 posts views Thread by Peter Duniho | last post: by

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.