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

  • Home
  • SEARCH
  • 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 7967947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:59:59+00:00 2026-06-04T06:59:59+00:00

I have a single class called MyClass which is inheriting from ListView…so basically it

  • 0

I have a single class called MyClass which is inheriting from ListView…so basically it is a list view and I can use it on a form,etc..I have overriden drag and drop events for this class so now if I put two of these controls on a form and drag items from one to the other, it will do it fine.
My problem is with DoubleClick, How can I implement DoubleClick() on this class? so when later I put two of these controls on a form and double click on a item on one of them, it will move it to the other control… Is it even possible?

  • 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-04T07:00:00+00:00Added an answer on June 4, 2026 at 7:00 am

    I was curious how this could be achieved so I tried it. I created a new windows forms project and created a myClass:ListView(see code below) Then I added two if the Controls to the Form, and tied them together using the sister property (which I did not really write up as a property)

    I added 1 item to myClass1 and 2 Items to myClass2. When I double click on anyof them, they move to the other listview.

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            myClass1.sister = myClass2;
            myClass2.sister = myClass1;
        }
    }
    
    public class myClass : ListView
    {
        //This is where we will store the information about the sister Control
        private myClass _sister;
        //**EDIT**  I changed sister into a property and now it is selectable
        //from the designer.
        public myClass sister { get { return _sister; } set { _sister = value; } }
    
        public myClass()
        {
        }
        //here is where we override the OnDoubleCLick Event
        protected override void OnDoubleClick(EventArgs e)
        {
            //Make sure this control has a sister 
            if (sister != null)
            {
                //add a temporary storage location for the selected Item
                ListViewItem item = this.SelectedItems[0];
                //Remove the Item from the clicked List
                this.Items.Remove(item);
                //Add the Item to the sister List
                ((myClass)sister).Items.Add(item);
            }
            base.OnDoubleClick(e);
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java class which handles both single valued and multi-valued data. Therefore,
Suppose you have a private static method called Inst() which allows the class to
Let's say I have a method that takes a class, which is called like
I have a class called FooJob() which runs on a WCF windows service. This
Say I have a class called PermissionManager which should only exist once for my
i have a module (a single .py file, actually), with a class called HashedDir.
i have one single class for margin and i am using this class to
I have the interface defined as below and is implemented by a single class
Instead of individually calling $(#item).removeClass() for every single class an element might have, is
Currently I have created a ABCFactory class that has a single method creating ABC

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.