Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9237725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:35:53+00:00 2026-06-18T07:35:53+00:00

The follwoing code refuses to work for drag and drop on the right mouse

  • 0

The follwoing code refuses to work for drag and drop on the right mouse click. When I right click the mouse I do see the proper context menu but I am not able to drag and drop although I do have an event handler for DragDrop , DragEnter, and DragOver. Is it because I can’t have context menu and drag and drop on the same right click? what am I doing wrong? Your help is very much appreciated.

private void treeList1_MouseDown(object sender, MouseEventArgs e)
{
    TreeList tree = sender as TreeList;
    Point pt = tree.PointToClient(MousePosition);
    TreeListHitInfo info = tree.CalcHitInfo(pt);

    if (e.Button == MouseButtons.Right && ModifierKeys == Keys.None && tree.State == TreeListState.Regular)
    {
        if (nodeType == typeof(X))
        {
            tree.ContextMenuStrip = XContextMenu;
            tree.FocusedNode = info.Node;
            treeList1.AllowDrop = true;
            tree.AllowDrop = true;
        }
        currentFocusNode = tree.FocusedNode;
        return;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:35:55+00:00Added an answer on June 18, 2026 at 7:35 am

    You’re not calling the DoDragDrop method.

    Here is an example of using DragDrop

    In your example, add something like this before the return;

    treeList1.DoDragDrop(currentFocusNode, DragDropEffects.Copy);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason my code refuses to work. I get a sigbart error in
The eclipse compiler refuses to compile the following code, stating that the field s
Whenever I use the following code, the webserver (running IIS 7) refuses to send
In our Struts2-Spring application we are using the follwoing lines of code access the
I have the following code which runs fine on my computer but fails online:
Why would file_put_contents refuse to work for the following code? $f = file_put_contents(files/r.js, Some
The following piece of code refuses to compile because the method: FollowPlayer is a
I'm using the following code which appears to work perfectly every time on Vista/Win7.
Why won't the following code work in C#? var c1 = new TcpClient(new IPEndPoint(IPAddress.Any,
I wonder why in the following code, MsBuild refuses to set the Suffix Metadata.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.