Difference between Keys.Shift and Keys.ShiftKey

两盒软妹~` 提交于 2019-11-29 05:28:37

Keys.Shift is a modifier key (used for key combinations) while Keys.ShiftKey is a regular key code just like most others in the Keys enumeration.

Keys.ShiftKey refers to the actual shift key while Keys.Shift refers to the shift modification itself. Keys.ShiftKey can be used like the other key codes to check for presses, but you cannot check to see if the Keys.Shift was pressed because it represents a state rather than an object. I hope this makes sense.

See here:

http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!