We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Clicking on +/- stops working after implementing MouseUp and MouseDown

Thread ID:

Created:

Updated:

Platform:

Replies:

68830 Oct 2,2007 08:16 PM UTC Oct 10,2007 05:10 AM UTC WinForms 1
loading
Tags: Tools
David Elliott
Asked On October 2, 2007 08:16 PM UTC

I derived from TreeViewAdv and implemented MouseDown and MouseUp as shown below. After I added these two events I can no longer click on the +/- of a node to expand or collapse. I can only do it through double clicking the text.

Any help is appreciated.
Dave

========

public partial class TreeView : TreeViewAdv
{
public TreeView()
{
InitializeComponent();
}


private void TreeView_MouseDown( object sender, MouseEventArgs e )
{
this.BeginUpdate();

if ( e.Button == MouseButtons.Right )
{
if ( (this.RMouseDownNode != null) &&
(this.RMouseDownNode.TextBounds.Contains( this.LastMousePositionToClient() )) )
{
this.SelectedNode = this.RMouseDownNode;
}
else
this.SelectedNode = null;
}
}

private void TreeView_MouseUp( object sender, MouseEventArgs e )
{
this.EndUpdate( true );
}
}

Jisha Joy [Syncfusion]
Replied On October 10, 2007 05:10 AM UTC

Hi David,

Thank you for your interest in Syncfusion Products.

The problem is because of the improper usage of BeginUpdate method. When you call the BeginUpdate method it will suspend the painting of control, so the process for expanding the node will not be performed. If you want to suspend the painting on right click then BeginUpdate method should be called after checking the MouseButton.

Please refer the sample from the below link that illustrate this.
Please refer the sample in the link to illustrate this:

rel='nofollow' href="
http://websamples.syncfusion.com/samples/Tools.Windows/68830/main.htm">http://websamples.syncfusion.com/samples/Tools.Windows/68830/main.htm

Please let me know if you have any questions.

Regards,
Jisha

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;