I'm starting to code a custom keyboard for my company, and I'm not sure why I don't have access to all keys in the designer. This seems like it should be very simple. One example key is Escape, but there are others.
New Project ->
right-click -> add new -> UserControl
UserControl1.vb
Public Class UserControl1
Private _myKey As Keys
Public Property MyKey() As Keys
Get
Return _myKey
End Get
Set(ByVal value As Keys)
_myKey = value
End Set
End Property
End Class
Build -> Form1 designer -> Drop UserControl1 onto Form1.vb
Form1.vb [Design]
->Select UserControl11
Properties -> Misc -> MyKey
try to set to Keys.Escape (or any number of others).
The available keys list is fairly verbose, but absolutely not complete.
What is the right way to do this? I would much prefer find a solution that allows me to do this via the designer than having to do this on load programmatically.
The below works, but again, I don't understand why I can't do this in the designer:
Public Class Form1
Public Sub New()
InitializeComponent()
UserControl11.MyKey = Keys.Escape
End Sub
End Class
I know I can define my own Enum and get it, but that's so much time for something that should probably just work with .net. What am I doing wrong here?
