【问题标题】:Autoplay video on windows form在 Windows 窗体上自动播放视频
【发布时间】:2017-02-08 10:47:07
【问题描述】:

我是 .net 新手,无法自动播放视频。我会在这里显示不同的文本框,但我希望视频在没有任何按钮的情况下自动播放

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WMPLib;

namespace ThinkQDisplay
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)
        {
             AxWindowsMediaPlayer1.URL = "C:\Users\Ramrod\Documents\Visual Studio 2012\Projects\ThinkQDisplay\ThinkQDisplay\sample.avi";
        }
    }
}

它一直告诉它是一个无法识别的转义序列。我也想有一个单独的表格(form2)。我可以在哪里选择在表格 1 上播放的内容。是否也可以循环播放?

【问题讨论】:

标签: c# axwindowsmediaplayer


【解决方案1】:
    private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)
    {
         axWindowsMediaPlayer1.URL = @"C:\Users\Ramrod\Documents\Visual Studio 2012\Projects\ThinkQDisplay\ThinkQDisplay\sampler.avi";
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        axWindowsMediaPlayer1.settings.autoStart = true;
    }
}

}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-19
    • 1970-01-01
    • 2014-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-20
    相关资源
    最近更新 更多