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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:26:26+00:00 2026-06-03T02:26:26+00:00

In relation to this post , I would like to offer the possibility to

  • 0

In relation to this post, I would like to offer the possibility to drag and drop video files into the windows media control, so they open automatically.

I have activated the AllowDrop property to no effect.

I’ve read that using an image control over the wmp control allows this, but I don’t know how to do it without it displaying over the video control.

Thanks.

  • 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-03T02:26:28+00:00Added an answer on June 3, 2026 at 2:26 am

    The best, cleaner solution is to wrap the embedded media player inside a User Control and make sure the media player AllowDrop property is set to “false” and the user control AllowDrop property is set to true. Make the embedded media player to dock to fill the user control then add it to your form as you would any user control. When you select the user control in your form you’ll see that the DragEnter and DragDrop events are exposed as expected. Handle them as you would do for an ordinary control (the code provided by Cody will do). You can see a complete example, in VB, in the following link (just don’t forget to make sure the actual embedded media player inside the user control has its AllowDrop property set to false, or else it will “hide” the drag events from the user control wrapper):

    http://www.code-magazine.com/article.aspx?quickid=0803041&page=5

    But if you just want to handle drag and drop anywhere over the Form, including over the media player control, all you need to do is to handle the DragEnter and DragDrop events of the container of the embedded media player ActiveX control and make sure the AllowDrop property of the actual embedded control is set to False as not to hide the drag events from the container, and the AllowDrop of the container is set to true.


    Here goes some code to clarify how you can use a container’s drag events to make up for the lack of drag and drop events of the media player ActiveX control.

    Just create a new form, name it MainForm, add the needed references to WMPLib to make the Media Player ActiveX control available to the application, size it so that it is wider than 320 pixels and taller than 220 pixels, and paste the code bellow into your main form code file:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Windows.Forms;
    using System.IO;
    using System.Diagnostics;
    using WMPLib;
    using AxWMPLib;
    
    namespace YourApplicationNamespace
    {
        public partial class MainForm : Form
        {
            public MainForm()
            {
                InitializeComponent();
                // 40 is the height of the control bar... 320 x 180 is 16:9 aspect ratio
                Panel container = new Panel()
                {
                    Parent = this,
                    Width = 320,
                    Height = 180 + 40,
                    AllowDrop = true,
                    Left = (this.Width - 320) / 2,
                    Top = (this.Height - 180 - 40) / 2,
                };
                AxWindowsMediaPlayer player = new AxWindowsMediaPlayer()
                {
                    AllowDrop = false,
                    Dock = DockStyle.Fill,
                };
                container.Controls.Add(player);
                container.DragEnter += (s, e) =>
                {
                    if (e.Data.GetDataPresent(DataFormats.FileDrop))
                        e.Effect = DragDropEffects.Copy;
                };
                container.DragDrop += (s, e) =>
                {
                    if (e.Data.GetDataPresent(DataFormats.FileDrop))
                    {
                        string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
                        var file = files.FirstOrDefault();
                        if (!string.IsNullOrWhiteSpace(file))
                            player.URL = file;
                    }
                };
            }
        }
    }  
    

    Now you can simply drag any media file over the media player control on the center of the form and it will accept it as a drop target and start playing the media file.

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

Sidebar

Related Questions

In relation to this stackoverflow question , how would I go about creating my
I have this problem decomposing a relation schema into a set of schemas that
There is an interesting post over here about this, in relation to cross-application flow
given a relation like this: |Posts | |Taggins | |Tags| |------| ---------- ------ |
This is relation to my other post but it is a different scenario. When
In relation to this question ( Efficient hashCode() implementation ) I have one more
This is in relation to this question . The proposed answers involve adding a
I have Cinema table & City table and I have relation with this tables
I have this table: itemA itemB relation 1 2 0.4 1 3 0.8 2
Why is the recurrence relation of recursive factorial algorithm this? T(n)=1 for n=0 T(n)=1+T(n-1)

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.