title: How do i pass keyUp/keyDown events to panel in visual basic?
body: <p>I have created a game in visual basic, and have decided to expand by adding multiple rooms on the game. Each room will be a panel that shows when the user enters a certain area. To start, I created a class that inherits panel properties, then added it to my main Form. I then added all the items to the panel controls. My issue is that i cannot control the player when it is in the panel controls. I have tried all sorts, but couldn't get it to work.</p>
  
  <p>I did some reading and found that panel does not come with keyUp() and keyDown() events. However, I would like to know if there is a way round this.</p>
  
  <p>Thanks in advance!</p>
  
  <p>Code of mainRoom() class (my panel):</p>
  
  <pre><code>Public Class mainRoom
      Inherits Panel
  
      Sub New()
          With Me
              .SetBounds(0, 0, Form1.Width, Form1.Height)
              .SendToBack()
          End With
      End Sub
  
      Public Sub mainRoom_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles Me.Paint
          e.Graphics.FillRectangle(Brushes.DarkOrange, block)
      End Sub
  End Class
  </code></pre>
  
  <p>In main form class:</p>
  
  <pre><code>Sub setMap()
      main = New mainRoom()
      Me.Controls.Add(main)
  End Sub
  </code></pre>