If I need to generate a keyboard layout for customization to the user that looks like his/her keyboard, how can I do it?
For instance something like this:
There is no built-in .NET class that contains the keyboard layouts. The keyboard layouts are a function of the Operating System, usually Windows. By the time .NET gets involved, the key pressed has been converted from a hardware event to a software one. If you want to see this in action, find 2 keyboard layouts where a key has moved between them. Setup a dummy app with an event handler on the Key_Down event, and then note that the event args are identical; if you pressed the - key you pressed the - key regardless of where that - key is located.