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 746371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:05:00+00:00 2026-05-14T14:05:00+00:00

I am using C# and Winforms 3.5 I have a list of user controls

  • 0

I am using C# and Winforms 3.5

I have a list of user controls all derived from one base class. These controls can be added to various panels and I’m trying to implement the drag-drop functionality, the problem I’m running in to is on the DragDrop event.

For DragEventArgs e.Data.GetData(typeof(baseClass)) doesn’t work. It wants:

e.Data.GetData(typeof(derivedClass1))
e.Data.GetData(typeof(derivedClass2))
etc...

Is there a way I can get around this, or a better way to architect it?

  • 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-05-14T14:05:00+00:00Added an answer on May 14, 2026 at 2:05 pm

    You can wrap the data in a common class. For example, assuming your base class is called DragDropBaseControl

    public class DragDropInfo
    {
      public DragDropBaseControl Control { get; private set; }
    
      public DragDropInfo(DragDropBaseControl control)
      {
        this.Control = control;
      }
    }
    

    And then the drag drop can be initiated with the following in the base class

    DoDragDrop(new DragDropInfo(this), DragDropEffects.All);
    

    And you can access the data in the drag events using the following

    e.Data.GetData(typeof(DragDropInfo));
    

    Have I understood your requirement correctly?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have integrated a small to-do list in my WinForms application, where-in user can
I have a WinForms application (I'm using VB) that can be minimized to the
I have a .net winforms ListBox and I've added items to it using .Add().
I have several controls in a winform application that I added databindings to using
Using winforms in vs2008. I have a DataGridView and I would like to detect
I have been playing around with the MVP pattern using winforms for the last
We have some corporate intranet users using a WinForms app to work on a
I have a BindingSource that I'm using in winforms data binding and I'd like
I am using Telerik WinForms RadGridView Control, I have set up Excel-like filtering, everything
I have an winforms application that was built using MVC. The controller is subscribing

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.