C#中Windows Media Player控件全屏模式下使用自定义控件

发布于 2024-09-26 18:44:23 字数 450 浏览 3 评论 0原文

我编写了一个使用 WindowsMediaPlayer 控件的视频播放器应用程序。从那时起,我开始使用 Photoshop,因此决定为其创建自己的按钮和控件,这样我就可以让它按照我想要的方式做出响应。我创建了一个新的用户控件,它有一个带有停靠在控件底部的新按钮的面板,以及一个“uimode”属性设置为“none”的 WindowsMediaPlayer 控件,填充了控件的其余部分。这一切都很好。

问题是,如果您在全屏模式下观看视频,则移动鼠标时不会看到任何按钮。有谁知道是否可以在全屏顶部显示一个面板,例如在屏幕的左下角而不退出全屏模式?我假设代码将进入 MouseHover 事件,并以 if 语句开头,因此仅当全屏属性为 true 时才会触发。

我什至也不是 100% 有必要使用 WindowsMediaPlayer 控件。我选择这个只是因为我熟悉它。如果有人知道任何其他可以实现我所追求的控件,那么我会愿意研究它们。

提前致谢

I have written a video player app that uses the WindowsMediaPlayer control. I have since started to use photoshop a bit and so decided to create my own buttons and controls for it so I could make it respond in exactly the way I want it to. I created a new user control which has a panel with the new buttons docked to the bottom of the control and a WindowsMediaPlayer control with the "uimode" property set to "none" filling the rest of the control. This all works fine.

The problem is that if you are viewing a video in full-screen mode you don't get any buttons when the mouse is moved. Does anyone know if it's possible to have a panel appear on top of the full screen in, say, the bottom left corner of the screen without exiting full screen mode? I'm assuming the code would go in the MouseHover event and would start with an if statement so it only fires if the fullscreen property is true.

It's also not 100% necessary that I even use the WindowsMediaPlayer control. I only picked this because I was familiar with it. If anyone knows any other controls that would achieve what I'm after then I'd be open to looking into them.

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏末 2024-10-03 18:44:23

这可以使用 MouseMove 事件来完成,所以。

private void MediaPlayer_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
   // Do a check to see if the player is fullscreen
   // Show button panel - you could use a group box for this if you wanted
   GroupBox.Left = 0;
   GroupBox.Top = 0; 
   GroupBox.Visible = True;
}

This can be done using a MouseMove event, so.

private void MediaPlayer_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
   // Do a check to see if the player is fullscreen
   // Show button panel - you could use a group box for this if you wanted
   GroupBox.Left = 0;
   GroupBox.Top = 0; 
   GroupBox.Visible = True;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文