0

I am making something like a 2d rpg game. Inside one of the room forms i have placed a small axWindowsMediaPlayer window to resemble a tv screen. The problem is that it somehow prevents the player from moving using arrow keys. After lots for experimenting I found out that when I change the following parameter from true to false, both the player and the character work correctly. However, after some unknown reasons the code line rewrites itself to true. How can I prevent visual studio from doing this?

// // axWindowsMediaPlayer1 // axWindowsMediaPlayer1.CausesValidation = false; axWindowsMediaPlayer1.Enabled = false; // The line that has the problem axWindowsMediaPlayer1.Location = new System.Drawing.Point(526, 43); axWindowsMediaPlayer1.Name = "axWindowsMediaPlayer1"; axWindowsMediaPlayer1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axWindowsMediaPlayer1.OcxState"))); axWindowsMediaPlayer1.Size = new System.Drawing.Size(90, 72); axWindowsMediaPlayer1.TabIndex = 4; axWindowsMediaPlayer1.TabStop = false;

  • see if this can help http://stackoverflow.com/questions/19249307/axwindows-media-player-dectect-keydown-in-full-screen-mode, basically try to intercept the keydown –  Oct 06 '15 at 15:03
  • Actually now that i notice, I can't even refer to the axWindowsMediaPlayer1 although it exists in the design... – Orestes Moressis Oct 06 '15 at 15:39
  • Do not edit designer-generated code, you'll lose all the changes when you make any design change. Set the Enabled property to False in the Properties window or in code. – Hans Passant Oct 06 '15 at 15:40
  • I know but there is no such a field as axWindowsMediaPlayer.enabled in properties window... – Orestes Moressis Oct 06 '15 at 20:07

0 Answers0