1

I'm working on a C# application which in I have a AxWindowsMediaPlayer control. I want to disable its controls individually, not all together. So far I have to use this code which disables all the controls

wmpPlayer.Ctlenabled = false;

Is there a way to disable for example just stop button?

I need to keep the Duration bar enabled and I don't want to hide them by uiMode.

Ghasem
  • 14,455
  • 21
  • 138
  • 171
  • i am afraid it is difficult to find a solution because the control does not have a property to disable just one button. but does it make sense to disable stop while user can click pause/next/fast forward? – kennyzx Oct 14 '14 at 09:38
  • @kennyzx The problem is if I use `wmpPlayer.Ctlenabled = false;` it will disables the `Duration bar` as well. But I need to have it enable. – Ghasem Oct 14 '14 at 09:41
  • The automation interface for the look-and-feel of the player was intentionally crippled. Too much of a hazard to innovation, WMP changed a great deal over the years. You can't make this work. Consider creating your own UI and just use WMP for playback. – Hans Passant Oct 14 '14 at 11:07

4 Answers4

2

@Alex Jolig I found the solucion.

1ΒΊ Select the windows media player and click in property pages (the key in properties), click there.

image 1

And select modo, select none in place of mini!!

Image2

And There is

Welcome!!

Andrezila
  • 25
  • 10
0

I can't found a way to disable controls and make then invisible... but i got the same effect by dragging an image box just over the Window Media Controls, so user can't operate and see them...

Slava Vedenin
  • 58,326
  • 13
  • 40
  • 59
0

This should work for not being able to stop:

if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsPaused)
{
            axWindowsMediaPlayer1.Ctlcontrols.play();
}

Put this on a Timer and then 1 on interval. After that just copy the timer and past it 10 times. I don't know if it makes any difference, but works for me as now.

trix
  • 878
  • 6
  • 14
Briko
  • 3
  • 4
0

"I can't found a way to disable controls and make then invisible... but i got the same effect by dragging an image box just over the Window Media Controls, so user can't operate and see them..."

Answer to this, since i can't add a comment: To hide Windows Media Controls: Click on properties on the player > Controls Layout > None (This will hide the controls)

To make it invisible: Put a timer and put enabled = true on properties > right click on the timer and Show Code Here put in:

If you want to close the player:

axWindowsMediaPlayer1.close();    

if you want to hide the player, but still play in the background:

axWindowsMediaPlayer1.Hide();

Click properties on the timer again and choose a interval

This will make Windows Media Player close/hide after a time (interval)

Briko
  • 3
  • 4