我正在制作类似于 2d rpg 游戏的东西。在其中一个房间表格中,我放置了一个类似于电视屏幕的小 axWindowsMediaPlayer 窗口。问题是它以某种方式阻止玩家使用箭头键移动。经过大量实验后,我发现当我将以下参数从 true 更改为 false 时,玩家和角色都可以正常工作。但是,在某些未知原因之后,代码行将自身重写为 true。如何防止视觉工作室这样做?
//
// 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;